Help required in Perl Script
1
0
Entering edit mode
8.4 years ago
riaasuddin • 0

Hello, I appreciate if someone can help me to write a script in perl for the following problem: Suppose I have a sequence like this:

MSTNPKPQRKTKRNTNRRPQDVKFPGGGQIVGGVYLLPRRGPRLGVRATRKTSERSQPRGRRQPIPKARRPEGRTWAQPGYPWPLYGNEGMGWAGWLLSPRGSRPSWGPTDPRRRSRNLGKVIDTLTCGFADLMGYIPLVGAPLGGAARALAHGVRVLEDGVNYATGNLPGCSFSIFLLALLSCLTTPVSAYEVRNVSGVYHVTNDCSNSSIVYEAADMIMHAPGCVPCVRENNSSRCWVALTPTLAARNISIPTTTIRRHVDLLVGAAAFCSAMYVGDLCGSVFLVSQLFTFSPRRHETVQDCNCSIYPGHVTGHRMAWDMMMNWSPTTALVVSQLLRIPQAIVDMVAGAHWGVLAGLAYYSMVGNWAKVLIVMLLFSGVDGETHVSGGTHGRGAHSFTGLFTFGASQKIQLVNTNGSWHINRTALNCNDSLQTGFIAALFYTHRFNSSGCPERMASCRPIDGFAQGWGPITYVEPDNLDQRPYCWHYAPRPCGIVPASQVCGPVYCFTPSPVVVGTTDRFGVPTYSWGENETDVLLLNNTRPPQGNWFGCTWMNSTGFTKTCGGPPCNIGGIGNNTLTCPTDCFRKHPEATYTKCGSGPWLTPRCLVHYPYRLWHYPCTVNFTIFKVRMYVGGVEHRLEAACNWTRGERCDLEDRDRSELSPLLLSTTEWQILPCSFTTLPALSTGLIHLHRNIVDVQYLYGIGSAVVSFAIKWEYILLLFLLLADARVCACLWMMLLIAQAEAALENLVVLNAASVAGTHGILSFLVFFCAAWYIKGRLVPGAAYALYGVWPLLLLLLALPPRAYAMDREMAASCGGAVFIGLALLTLSPYYKVFLARLIWWLQYFITRAEAHLQVWVPPLNVRGGRDAIIILACAVHPGLIFDITKLLLAILGPLMVLQAGITRMPYFVRAQGLIRACMLVRKAAGGHYIQMAFMKLAALTGTYIYDHLAPLQHWAHAGLRDLAVAVEPVVFSDMETKIITWGADTAACGDIILGLP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RVGDFHYVTGMTTDNVKCPCQVPAPEFFTEVDGVRLHRYAPVCKPLLREEVTFQVGLNQYLVGSQLPCEPEPDVAVLTSMLTDPSHITAETAKRRLARGSPPSLASSSASQLSAPSLKATCTTHHDSPDADLIEANLLWRQEMGGNITRVESENKVVILDSFDPLHAEEDEREVSVAAEILRKSRKFPTALPIWARPDYNPPLLESWKDPEYVPPVVHGCPLPPTKAPPIPPPRRKRTVVLTESTVSSALAEFATKTFGSSESSAVDSGTATAPPDQASDDGDKGSDVESYSSMPPLEGEPGDPDLSDGSWSTVSEEAGEDVVCCSMSYTWTGALITPCAAEESKLPINPLSNSLLRHHNMVYATTSRSASLRQKKVTFDRLQVLDDHYRDVLKEMKAKASTVKAKLLSIEEACKLTPPHSAKSKYGYGAKDVRNLSSKAINHIHSVWEDLLEDTETPIDTTIMAKSEVFCVQPEKGGRKPARLIVFPDLGVRVCEKMALYDVVSTLPQAVMGSSYGFQYSPKQRVEFLVNTWKSKKSPMGFSYDTRCFDSTVTENDIRVEESIYQCCDLAPEAKRAIRSLTERLYIGGPLTNSKGQNCGYRRCRASGVLTTSCGNTLTCYLKASAACRAAKLQDCTMLVNGDDLVVICESAGTQEDAERLRAFTEAMTRYSAPPGDPPQPEYDLELITSCSSNVSVAHDASGKRVYYLTRDPTTPLARAAWETARHTPVNSWLGNIIMYAPTLWARMILMTHFFSILLAQEQLEKALDCQIYGACYSIEPLDLPQIIERLHGLSAFSLHSYSPGEINRVASCLRKLGVPPLRVWRHRARSVRAKLLSQGGRAATCGKYLFNWAVRTKLKLTPIPAASRLDLSGWFVAGYSGGDIYHSLSRARPRWFMLCLLLLSVGVGIYLLPNR

The above sequence has a motif like YEVR and I need to print sequence from Y till the 192th position of the sequence. The output of above sequence should be like following:

YEVRNVSGVYHVTNDCSNSSIVYEAADMIMHAPGCVPCVRENNSSRCWVALTPTLAARNISIPTTTIRRHVDLLVGAAAFCSAMYVGDLCGSVFLVSQLFTFSPRRHETVQDCNCSIYPGHVTGHRMAWDMMMNWSPTTALVVSQLLRIPQAIVDMVAGAHWGVLAGLAYYSMVGNWAKVLIVMLLFSGVDG

I have to apply this perl script to many sequences.

Thanks.

Reaz

sequence genome • 1.2k views
ADD COMMENT
1
Entering edit mode
8.4 years ago
Asaf 10k
my $a = "MSTN....."
my $I = index($a, "YEVR");
print substr($a, $I, 192);

This will print from first occurrence of "YEVR" 192 AA. Of course you better put the motif in a variable and have it as an input argument for the script along with the sequences.

ADD COMMENT

Login before adding your answer.

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