BioPython : comparing same sequence with two different databases
1
0
Entering edit mode
10.1 years ago
sukeshssk ▴ 10

I compared query sequence with two different genomes( Genome1 and Genome 2) individually using Standalone BLAST and saved in two different files. Now, I wanted to store these information in following format using python.

Query     Genome 1    Genome 2
gi ID     gi ID 1     gi ID 2
Length    Length      Length
          E-value     E-value
          Score       Score

Somebody have any suggestions to store this information in above format.

Thank you

blast • 1.9k views
ADD COMMENT
0
Entering edit mode
10.1 years ago
sfcarroll ▴ 80

Store it in a dictionary, with the results in a list

>>> query = {'giID': 12345, 'length': 344999, 'genomes': [{'giID':123,'length':3008, 'score': 1 },{'giID':999,'length':500, 'e-value': 0.7}]}

Then to access the query

>>> query
{'length': 344999, 'genomes': [{'length': 3008, 'score': 1, 'giID': 123}, {'length': 500, 'e-value': 0.7, 'giID': 999}], 'giID': 12345}

Access all results

>>> query['genomes']
[{'length': 3008, 'score': 1, 'giID': 123}, {'length': 500, 'e-value': 0.7, 'giID': 999}]

Access the first result only

>>> query['genomes'][0]
{'length': 3008, 'score': 1, 'giID': 123}

You could also store it in a database (SQL or NoSQL) and then extract it from the database in this format.

ADD COMMENT

Login before adding your answer.

Traffic: 2571 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6