omnicoders / bio-geolocation Goto Github PK
View Code? Open in Web Editor NEWLooks up the location of sequences in GenBank and adds it to a FASTA file.
Looks up the location of sequences in GenBank and adds it to a FASTA file.
The following record has odd characters in the sequence name, which cause the output file to be corrupt because there are two > brackets in a row instead of a > and a sequence like the FASTA format specifies.
https://www.ncbi.nlm.nih.gov/nuccore/MF140467.1
The output line looks like this:
MF140467.1 Coprinellus sp. Ireland: Gurraig
:2282 internal transcribed spacer 1, partial sequence; 5.8 internal transcribed No Location Provided
CCTGCGGAAGGATCATTAACGAATAACTATGGTGTCTTGGTTGTAGCTGGCTCCTCGGAGCATTGTGCACGCCCGCCATT
Correct output should be:
MF140467.1 Coprinellus sp. Ireland: Gurraig
CCTGCGGAAGGATCATTAACGAATAACTATGGTGTCTTGGTTGTAGCTGGCTCCTCGGAGCATTGTGCACGCCCGCCATT
Here is a FASTA file that will hang the code:
X>HQ604824.1 Amanita gemmata isolate BD 34 voucher UBC:F19764 18S ribosomal RNA gene, partial sequence; internal transcribed spacer 1, 5.8S ribosomal RNA gene, and internal transcribed spacer 2, complete sequence; and 28S ribosomal RNA gene, partial sequence
ACCC
Remove the X to make it back into a valid FASTA, otherwise github thinks it's a quote.
Some of the sequences are missing from the result file that are present in the source file.
>FJ475559.1 Uncultured Suillaceae clone AhedenA42 18S ribosomal RNA gene, partial sequence; internal transcribed spacer 1, 5.8S ribosomal RNA gene, and internal transcribed spacer 2, complete sequence; and 28S ribosomal RNA gene, partial sequence >FN565360.1 Uncultured Suillus 18S rRNA gene (partial), ITS1, 5.8S rRNA gene, ITS2 and 28S rRNA gene (partial), clone 7.17 >FN565362.1 Uncultured Suillus 18S rRNA gene (partial), ITS1, 5.8S rRNA gene, ITS2 and 28S rRNA gene (partial), clone 7.13 >FN565363.1 Uncultured Suillus 18S rRNA gene (partial), ITS1, 5.8S rRNA gene, ITS2 and 28S rRNA gene (partial), clone 6.17
CTTGGTCATTTAGAGGAAGTAAAAGTCGTAACAAGGTTTCCGTAGGTGAACCTGCGGAAGGATCATTAAAGAAATAATCT
CGAGGGCCTTCGGAAAGGAGAGAGGGTTGTAGCTGGCTTAAGCATGTGCACGCCCTCTTTCTCGACCTAGGTCCTTATGG
GCGCGGGGCGACCCGCGTCTTCATAAGCCCCTTCGTGTAGAAAGTCTATGAATGTTTTTACCATCATCGACTCGCGACTT
CTAGGAGACGCGATTCTTTGAGACAAAAGTTATTACAACTTTCAGCAATGGATCTCTTGGCTCTCGCATCGATGAAGAAC
GCAGCGAATCGCGATATGTAATGTGAATTGCAGATCTACAGTGAATCATCGAATCTTTGAACGCACCTTGCGCTTATCGG
TGTTCCGATGAGCATGCCTGTTTGAGCGTCATTAAATTCTCAACCCCTCTCGATTTGCTTCGAGAGGGAGCTTGGATCGT
GGAGGCTGCCGGAGACCTGTTTTTCAGGACTCGGGCTCCTCTGAAATGTATTGGCTTGCGGTCGACTTTCGACTGTGCAT
GACAAGGCCTTTGGCGTGATAATGATCGCCGCTCGCCGAAGTGCACGAACGAATGGTCTCGTGCCTCTAATCAGTCGACG
CCTTTTCGAAGGCGTCTTCCTTATTGACGTTTGACCTCAAATCAGGTAGGACTACCCGCTGAACTTAAGCATATCAATAA
GCGGAGGA
>FJ475559.1 Uncultured Suillaceae Sweden
Most species are just two words - the genus and the species. However when we know the genus but the species is a guess, the abbreviation cf. or aff. is used to indicate that it's not necessarily that species.
Here is an example FASTA file which truncates the species name:
X>MG827096.1 Amanita cf. pantherina voucher MushroomObserver.org/306343 internal
transcribed spacer 1 and 5.8S ribosomal RNA gene, partial sequence
AAACTCAGGTAGGGGGGGAGGTGGTTGTAGCTGGCCCCCTAGTAAGGGCATGTGCACACTGTCTCTTTCTCTTGCTTGTTTTTTTCATTCTTTCCACTTGTGCACTGCTTGTAGGCAGCCTGGCATTGTTCAGGTTGTCTATGATTTTCTTTACATACATGAATAATCGTTGTACAGAATGTAATGAAAAAAAAAGTAATACAACTTTCAACAACGGATCTCTTGGCTCTCGCATC
Remove the X before the > - I just put it there so Github wouldn't see the carat as a quote.
When I made a phylogenetic tree of Psilocybe sect. Aztecorum, three collections from the Czech republic showed up as being from Oregon.
The country field is set to Czech republic.
Here is the fasta file, renamed to txt
Parenthesis and probably other funny characters too should be stripped, as they cause bad output to be written.
An example of a record which causes this issue is https://www.ncbi.nlm.nih.gov/nuccore/MF423716
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.