-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from mdshw5/mtime_reindex
- Loading branch information
Showing
25 changed files
with
419 additions
and
1,294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python | ||
import os.path | ||
|
||
def fetch_fasta(filename): | ||
from Bio import Entrez | ||
Entrez.email = "mdshw5@gmail.com" | ||
|
||
id_list = ['563317589', '557361099', '557361097', '543583796', | ||
'543583795', '543583794', '543583788', '543583786', | ||
'543583785', '543583740', '543583738', '530384540', | ||
'530384538', '530384536', '530384534', '530373237', | ||
'530373235', '530364726', '530364725', '530364724'] | ||
|
||
search_results = Entrez.read(Entrez.epost("nucleotide", id=",".join(id_list))) | ||
|
||
webenv = search_results["WebEnv"] | ||
query_key = search_results["QueryKey"] | ||
|
||
records = Entrez.efetch(db="nucleotide", rettype="fasta", retmode="text", webenv=webenv, query_key=query_key) | ||
|
||
with open(filename, 'w') as fasta: | ||
for line in records: | ||
if len(line) > 1: # skip lines with only \n | ||
fasta.write(line) | ||
|
||
|
||
if __name__ == "__main__": | ||
path = os.path.dirname(__file__) | ||
os.chdir(path) | ||
fasta_name = "genes.fasta" | ||
fetch_fasta(fasta_name) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.