How to extract ORF_ID(LR590472.1_162 ) from large number of txt file
1
0
Entering edit mode
2.4 years ago
Neel ▴ 20
Hi, i want to extract ORF_ID (for example lets suppose this is ORF_ID LR590472.1_162 for one seq/ gene, similarly i want to extract for all gene with according to their file name) of all the sequence as well as DNA seq from txt file which also have protein seq.


ORF_ID  Contig  Start   Stop    Orientation     Cut_Off Pass_Bitscore   Best_Hit_Bitscore       Best_Hit_ARO    Best_Identities ARO     Model_type      SNPs_in_Best_Hit_ARO    Other_SNPs      Drug Class
      Resistance Mechanism    AMR Gene Family Predicted_DNA   Predicted_Protein       CARD_Protein_Sequence   Percentage Length of Reference Sequence ID      Model_ID        Nudged  Note
**LR590472.1_162** # 174925 # 176028 # 1 # ID=1_162;partial=00;start_type=ATG;rbs_motif=None;rbs_spacer=None;gc_cont=0.708  LR590472.1_162  174925  176028  +       Strict  650     726.472 TriA    99.73   3003679 protein homolog model   n/a     n/a     disinfecting agents and antiseptics     antibiotic efflux       resistance-nodulation-cell division (RND) antibiotic efflux pump        ATGGCGCTGCCCGCCATCCTGTGCGCCGGCCTGCTTGTCGGTTGCGGCGCCGAGCCGCCCGCCGAGGAACACGTCCGTGTGCTGGCGCAGACGGTGAAGATGGCCGAGTTCGCCTCGGCCACCTCGATCACCGGCGACATCCAGGCACGGGTACAGGCCGACCAGTCGTTCCGTGTCGGCGGCAAGATCGTCGAGCGCCTGGTCGATGTCGGCGACCACGTCGCGGCTGGCCAGGTGCTGGCGCGGCTCGACCCGCAGGACCAGCGCAGCAACGTGGAGAACGCCCAGGCGGCGGTCGCCGCGCAGCAGGCGCAGTCGAAGCTCGCCGACCTCAACTACCAGCGGCAGAAGGCGCTGCTGCCCAAGGGCTACACCAGCCAGAGCGAGTACGACCAGGCGCTGGCCTCGGTGCGCAGCGCGCAGAGTTCGCTGAAGGCCGCCCAGGCGCAGTTGGCCAACGCCCGCGACCTGCTTTCCTATACCGAGCTGCGTGCCTCCGACGCCGGGGTCATCACTGCCCGCCAGGCCGAGGTCG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YTELRASDAGVITARQAEVGQVVQATVPIFTLARDGERDAVFNVYESLFSHDVDGQRITVSLLGKPEVTASGKVREITPTVDERSGTLKVKVGLDSVPAEMSLGSVVNASVAAPAEHSVVLPWSALSKVGEQPAVWLLDQQGKARLQPVRVARYASEKVVIDGGLEAGQTVVTVGGQLLHPGQVVEVAQPPQPTQSTASRDAVGGGQP 95.82   gnl|BL_ORD_ID|2005|hsp_num:0    2192            
**LR590472.1_163** # 176025 # 177095 # 1 # ID=1_163;partial=00;start_type=ATG;rbs_motif=GGAG;rbs_spacer=7bp;gc_cont=0.709   LR590472.1_163  176025  177095  +       Strict  600     697.582 TriB    99.72   3003680 protein homolog model   n/a     n/a     disinfecting agents and antiseptics     antibiotic efflux       resistance-nodulation-cell division (RND) antibiotic efflux pump        ATGAAGCCGTTTTCCCTCGCCGGCCTGTTCGGCTTCGCCCTGCTCCTCTCCGGCTGCGGCGACGAGCCGCCGCCGGCACCGCCGCGGCCGGTGCTGACGGTGACCGTGAAGACCCTGAAGAACGACGACCTCGGTCGCTTCGCCGGGAGCATCCAGGCGCGCTACGAGAGCGTGCTCGGCTTCCGCACCAACGGACGGATCGCCTCGCGCCTGTTCGACGTCGGTGACTTCGTCGGCAAGGGCGCGCTGCTGGCGACCCTCGACCCCACCGACCAGCAGAACCAGTTGCGCGCCAGCCAGGGCGACCTGGCCAGCGCCGAGGCACAGTTGATCGACGCCCAGGCCAATGCCCGGCGCCAGGAAGAACTGTTCGCCCGCAGCGTCACCGCCCAGGCGCGCCTGGACGATGCGCGGACCCGCCTGAAGACCAGCCAGGCCAGCTTCGACCAGGCCAAAGCGACGGTGCAGCAGGCCAGGGACCAGCTTTCCTACACGCGCCTGGTGACCGATTTCGACGGCGTCATCACCACCTGGCACGCCGAGGCCGGGCAAGTGGTCAGCGCCGGCCAGGCGGTGGTCACCCTGGCCCGGCCCGAAGTGCGCGAGGCGGTCTTCGACCTGCCCACCGAGGTCGCCGAGAGCCTGCCGGCCGACGCGCGCTTCCTG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AR    100.00  gnl|BL_ORD_ID|2006|hsp_num:0    2193            



Thank you!
fasta • 699 views
ADD COMMENT
0
Entering edit mode
2.4 years ago
GenoMax 147k

Looks like your file is space separated so something like this should work. testfile contains the two lines from your example above. Sequence trimmed to save space.

$  awk -F " " '{print ">"$1"\n"$37}' testfile 
>LR590472.1_162
ATGGCGCTGCCCGCCATCCTGTGCGCCGGCCTGCTTGTCGGTTGCGGCGCCGAGCCGCCCGCCGAGGAACACGTCCGTGTGCTGGCGCAGACGGTGAAGATGGCCGAGTTCGCCTCGGCCACCTCGATCACCGGCGACATCCAGGCACGGGTACAGGCCGACCAGTCGTTCCGTGTCGGCGGCAAGATCGTCGAGCGCCTGGT
>LR590472.1_163
ATGAAGCCGTTTTCCCTCGCCGGCCTGTTCGGCTTCGCCCTGCTCCTCTCCGGCTGCGGCGACGAGCCGCCGCCGGCACCGCCGCGGCCGGTGCTGACGGTGACCGTGAAGACCCTGAAGAACGACGACCTCGGTCGCTTCGCCGGGAGCATCCAGGCGCGCTACGAGAGCGTGCTCGGCTTCCGCACCAACGGACGGATCGC


$ awk -F " " '{print ">"$1"\n"$38}' testfile 
>LR590472.1_162
MALPAILCAGLLVGCGAEPPAEEHVRVLAQTVKMAEFASATSITGDIQARVQADQSFRVGGKIVERLVDVGDHVAAGQVLARLDPQDQRSNVENAQAAVAAQQAQSKLADLNYQRQKALLPKGYTSQSEYDQALASVRSAQSSLKAAQAQLANARDLLSYTELRASDAGVITARQAEVGQVVQATVPIFTLARDGERDAVFNVYESLFSHDVDGQRITVSLL
>LR590472.1_163
MKPFSLAGLFGFALLLSGCGDEPPPAPPRPVLTVTVKTLKNDDLGRFAGSIQARYESVLGFRTNGRIASRLFDVGDFVGKGALLATLDPTDQQNQLRASQGDLASAEAQLIDAQANARRQEELFARSVTAQARLDDARTRLKTSQASFDQAKATVQQARDQLSYTRLVTDFDGVITTWHAEAGQVVSAGQAVVTLARPEVREAVFDLPTEVAESLPADARF

Once you get the files (redirect output using > DNAfile and proteinfile after the commands above). You can split the individual sequences in separate files (if that is what you want) using faSplit utility from Jim Kent. how to use faSplit to split fasta into x files

ADD COMMENT
0
Entering edit mode

Thank you so much but it didn't separate all DNA and protein seq. Please have a look the the file which i shared on pastebin.com. Basically i want to separate each and every DNA seq of gene from one file as well as other 200 txt file also.

ADD REPLY

Login before adding your answer.

Traffic: 1899 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