Entering edit mode
9.2 years ago
vinij80
▴
30
Hi,
I have two sequence file. I want only the matching sequences which is present on both files and save that output in third file. Can you please help me for creating perl program for this?
FILE1:
>Contig1
TTCAAAAACTCATATGGGTGGTACAATGCGTCTTGGATCTAGGAGAACATATTTTCAAGTTGCAGATTGTAAATCTGCAAAATTATATGGTAACCAGAGCTTTGTAGATGAGAGGCATCGACACAGATATGAGGTGAACCCCGACATGGTGCAGC
>Contig2
GACTTGAAGATGCTGGTCTTTCTTTCACTGGCAAAGATGAAAGTGGTCATCGCATGGAGATTGTTGAGCTGCCGAGTCATCCTTACTTCATCGGAGTTCAATTTCATCCAGAATTTAAATCAAGGCCAGGAACCCCTTCAGCCCTGTTT
>Contig3
CTAGGACTTATAGCCGCAGCAACTGGGCAACTTGAAACTCTCTTGAAGAAGGGTGTTCCCAAAACATGGGGGTTGAGCAATGGTACGTCAGGACTAAAATCACATCGATATGTAAATGGGACAAAACTGTTTAATGGATCATTAGATG
>Contig4
GCATTTATTGCAATGGGAATGGTATACATGTTTAAAGGAAACAGTAACATATGTTGTGGGCGCTTGGCCCCGGATTTTTGATAATCAAATTTTGCTACTGCATTTTTTTTAAAG
>Contig5
CCCCCCCTTATTTGTCGTTTTTGATAATCAAATTTTGCTACTGCATTTTTTTTAAAG
FILE2:
>Contig1
TTCAAAAACTCATATGGGTGGTACAATGCGTCTTGGATCTAGGAGAACATATTTTCAAGTTGCAGATTGTAAATCTGCAAAATTATATGGTAACCAGAGCTTTGTAGATGAGAGGCATCGACACAGATATGAGGTGAACCCCGACATGGTGCAGC
>Contig3
CTAGGACTTATAGCCGCAGCAACTGGGCAACTTGAAACTCTCTTGAAGAAGGGTGTTCCCAAAACATGGGGGTTGAGCAATGGTACGTCAGGACTAAAATCACATCGATATGTAAATGGGACAAAACTGTTTAATGGATCATTAGATG
>Contig4
GCATTTATTGCAATGGGAATGGTATACATGTTTAAAGGAAACAGTAACATATGTTGTGGGCGCTTGGCCCCGGATTTTTGATAATCAAATTTTGCTACTGCATTTTTTTTAAAG
>Contig6
GCATTTATTGCAATGTTTTGATAATCAAATTTTGCTACTGCATTTTTTTTAAAGCCAGAGCTTTGTAGATGAGAGGCATGGTACAATGCGTCTTG
EXPECTED OUTPUT:
>Contig1
TTCAAAAACTCATATGGGTGGTACAATGCGTCTTGGATCTAGGAGAACATATTTTCAAGTTGCAGATTGTAAATCTGCAAAATTATATGGTAACCAGAGCTTTGTAGATGAGAGGCATCGACACAGATATGAGGTGAACCCCGACATGGTGCAGC
>Contig3
CTAGGACTTATAGCCGCAGCAACTGGGCAACTTGAAACTCTCTTGAAGAAGGGTGTTCCCAAAACATGGGGGTTGAGCAATGGTACGTCAGGACTAAAATCACATCGATATGTAAATGGGACAAAACTGTTTAATGGATCATTAGATG
>Contig4
GCATTTATTGCAATGGGAATGGTATACATGTTTAAAGGAAACAGTAACATATGTTGTGGGCGCTTGGCCCCGGATTTTTGATAATCAAATTTTGCTACTGCATTTTTTTTAAAG
What do you want to do is something basic. So, if you are learning Perl and bioinformatics you may have a look to this perl guide. You have all information in this guide in order to reach your goal.
Then, if we talk about algorithms, what you have to use is something like this:
I don't know how to write this program. Can you please help me?
Hello vinij80!
It appears that your post has been cross-posted to another site: cross posted: http://seqanswers.com/forums/showthread.php?t=63159
This is typically not recommended as it runs the risk of annoying people in both communities.