This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert XML file to FASTA

Hi everyone,

I have downloaded polypeptide data which format is called Chado XML. As I opened it, it seems quite a new format in comparison to other formats, so I would like to know if there's any way to convert to FASTA, as it is the format needed as input.

I really appreciate any help you can provide.

chado-xml conversion flybase polypeptides

According to this wiki page, there's a way to convert TO Chado XML using bioperl, maybe it can be used the other way around as well?

BioPerl has a write-adapter for Chado-XML, Bio::SeqIO::chadoxml. This means that any file format which Bioperl can pass can be exported to Chado-XML.

If you are not familiar with the bioperl SeqIO system, you can do it on the command line, like this:

bp_seqconvert --from genbank --to chadoxml < NT_021877.gbk

Yes, unfortunately, it seems that it only works the other way around, obtaining XML files instead of getting rid of them.

1 answer

write a SAX or Stax parser to extract the data

        <name>CG9570-PA</name>
        <timelastmodified>2004-06-05 04:27:57</timelastmodified>
        <residues>MTCTLVLLIASVLHFRMRGSCLLDIERFPVIPGTIYAGHIAYCAILYFLHDLEILPTRYRSRMGWLTTFLIELVLGVAFMEVLALWLW
CSVEHILHLSTQFVLRRYLGVSTEVYQRWEWAIMGGLMTTLAAMLWINAFEATETTKAERVSKDVKDIRMKAVLCQREEKQKQDHDLEKIEQPAPEPEESQNPDEVQLPENHLK
LLATTTDC</residues>
        <is_obsolete>0</is_obsolete>
        <uniquename>FBpp0070001</uniquename>
        <seqlen>210</seqlen>
        <md5checksum>54d605138ac28e802cdf493751b71b17</md5checksum>

Thanks for your early answer. Are these parsers usually written in java? My programming languages only comprise Perl, Python, R, bash and MySQL. Even so, I'll see if I can work on it.

In the end I found a site in the same database where the data is included in the desired format, so I didn't need to perform it. Anyway, thanks for your help.

Log in to answer this question.