Showing
1 changed file
with
11 additions
and
1 deletions
... | @@ -22,6 +22,8 @@ __author__ = 'CMendezC' | ... | @@ -22,6 +22,8 @@ __author__ = 'CMendezC' |
22 | # --inputPath /export/space1/users/compu2/bionlp/conditional-random-fields/data-sets | 22 | # --inputPath /export/space1/users/compu2/bionlp/conditional-random-fields/data-sets |
23 | # --inputFile text-annotated-abstracts-original.txt | 23 | # --inputFile text-annotated-abstracts-original.txt |
24 | # --outputPath /export/space1/users/compu2/bionlp/conditional-random-fields/data-sets/original | 24 | # --outputPath /export/space1/users/compu2/bionlp/conditional-random-fields/data-sets/original |
25 | +# --dicPath /export/space1/users/compu2/bionlp/nlp-preprocessing-pipeline/dictionaries | ||
26 | +# --dicFile genes.txt | ||
25 | # python3 prepare-abstracts.py --inputPath /export/space1/users/compu2/bionlp/conditional-random-fields/data-sets --inputFile text-annotated-abstracts-original.txt --outputPath /export/space1/users/compu2/bionlp/conditional-random-fields/data-sets/original | 27 | # python3 prepare-abstracts.py --inputPath /export/space1/users/compu2/bionlp/conditional-random-fields/data-sets --inputFile text-annotated-abstracts-original.txt --outputPath /export/space1/users/compu2/bionlp/conditional-random-fields/data-sets/original |
26 | 28 | ||
27 | if __name__ == "__main__": | 29 | if __name__ == "__main__": |
... | @@ -33,6 +35,10 @@ if __name__ == "__main__": | ... | @@ -33,6 +35,10 @@ if __name__ == "__main__": |
33 | help="Input file", metavar="FILE") | 35 | help="Input file", metavar="FILE") |
34 | parser.add_option("--outputPath", dest="outputPath", | 36 | parser.add_option("--outputPath", dest="outputPath", |
35 | help="Output path", metavar="PATH") | 37 | help="Output path", metavar="PATH") |
38 | + parser.add_option("--dicPath", dest="dicPath", | ||
39 | + help="Dictionary path", metavar="PATH") | ||
40 | + parser.add_option("--dicFile", dest="dicFile", | ||
41 | + help="Dictionary file", metavar="FILE") | ||
36 | 42 | ||
37 | (options, args) = parser.parse_args() | 43 | (options, args) = parser.parse_args() |
38 | if len(args) > 0: | 44 | if len(args) > 0: |
... | @@ -44,6 +50,8 @@ if __name__ == "__main__": | ... | @@ -44,6 +50,8 @@ if __name__ == "__main__": |
44 | print("Input path: " + str(options.inputPath)) | 50 | print("Input path: " + str(options.inputPath)) |
45 | print("Input file", str(options.inputFile)) | 51 | print("Input file", str(options.inputFile)) |
46 | print("Output path: " + str(options.outputPath)) | 52 | print("Output path: " + str(options.outputPath)) |
53 | + print("Dictionary path: " + str(options.dicPath)) | ||
54 | + print("Dictionary file", str(options.dicFile)) | ||
47 | 55 | ||
48 | filesWritten = 0 | 56 | filesWritten = 0 |
49 | t0 = time() | 57 | t0 = time() |
... | @@ -69,6 +77,8 @@ if __name__ == "__main__": | ... | @@ -69,6 +77,8 @@ if __name__ == "__main__": |
69 | oFile.write(line) | 77 | oFile.write(line) |
70 | else: | 78 | else: |
71 | print("Warning: line without PMID") | 79 | print("Warning: line without PMID") |
72 | - | 80 | + with open(os.path.join(options.dicPath, options.dicFile), "w", encoding="utf-8", errors="replace") as dFile: |
81 | + for gene in hashGenes.keys(): | ||
82 | + dFile.write("{}\n".format(gene)) | ||
73 | 83 | ||
74 | 84 | ... | ... |
-
Please register or login to post a comment