Question: Help required in Perl Script
0
gravatar for riaasuddin
3.7 years ago by
riaasuddin0
riaasuddin0 wrote:

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:

MSTNPKPQRKTKRNTNRRPQDVKFPGGGQIVGGVYLLPRRGPRLGVRATRKTSERSQPRGRRQPIPKARRPEGRTWAQPGYPWPLYGNEGMGWAGWLLSPRGSRPSWGPTDPRRRSRNLGKVIDTLTCGFADLMGYIPLVGAPLGGAARALAHGVRVLEDGVNYATGNLPGCSFSIFLLALLSCLTTPVSAYEVRNVSGVYHVTNDCSNSSIVYEAADMIMHAPGCVPCVRENNSSRCWVALTPTLAARNISIPTTTIRRHVDLLVGAAAFCSAMYVGDLCGSVFLVSQLFTFSPRRHETVQDCNCSIYPGHVTGHRMAWDMMMNWSPTTALVVSQLLRIPQAIVDMVAGAHWGVLAGLAYYSMVGNWAKVLIVMLLFSGVDGETHVSGGTHGRGAHSFTGLFTFGASQKIQLVNTNGSWHINRTALNCNDSLQTGFIAALFYTHRFNSSGCPERMASCRPIDGFAQGWGPITYVEPDNLDQRPYCWHYAPRPCGIVPASQVCGPVYCFTPSPVVVGTTDRFGVPTYSWGENETDVLLLNNTRPPQGNWFGCTWMNSTGFTKTCGGPPCNIGGIGNNTLTCPTDCFRKHPEATYTKCGSGPWLTPRCLVHYPYRLWHYPCTVNFTIFKVRMYVGGVEHRLEAACNWTRGERCDLEDRDRSELSPLLLSTTEWQILPCSFTTLPALSTGLIHLHRNIVDVQYLYGIGSAVVSFAIKWEYILLLFLLLADARVCACLWMMLLIAQAEAALENLVVLNAASVAGTHGILSFLVFFCAAWYIKGRLVPGAAYALYGVWPLLLLLLALPPRAYAMDREMAASCGGAVFIGLALLTLSPYYKVFLARLIWWLQYFITRAEAHLQVWVPPLNVRGGRDAIIILACAVHPGLIFDITKLLLAILGPLMVLQAGITRMPYFVRAQGLIRACMLVRKAAGGHYIQMAFMKLAALTGTYIYDHLAPLQHWAHAGLRDLAVAVEPVVFSDM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NYSRALWRVAAEEYVEVTRVGDFHYVTGMTTDNVKCPCQVPAPEFFTEVDGVRLHRYAPVCKPLLREEVTFQVGLNQYLVGSQLPCEPEPDVAVLTSMLTDPSHITAETAKRRLARGSPPSLASSSASQLSAPSLKATCTTHHDSPDADLIEANLLWRQEMGGNITRVESENKVVILDSFDPLHAEEDEREVSVAAEILRKSRKFPTALPIWARPDYNPPLLESWKDPEYVPPVVHGCPLPPTKAPPIPPPRRKRTVVLTESTVSSALAEFATKTFGSSESSAVDSGTATAPPDQASDDGDKGSDVESYSSMPPLEGEPGDPDLSDGSWSTVSEEAGEDVVCCSMSYTWTGALITPCAAEESKLPINPLSNSLLRHHNMVYATTSRSASLRQKKVTFDRLQVLDDHYRDVLKEMKAKASTVKAKLLSIEEACKLTPPHSAKSKYGYGAKDVRNLSSKAINHIHSVWEDLLEDTETPIDTTIMAKSEVFCVQPEKGGRKPARLIVFPDLGVRVCEKMALYDVVSTLPQAVMGSSYGFQYSPKQRVEFLVNTWKSKKSPMGFSYDTRCFDSTVTENDIRVEESIYQCCDLAPEAKRAIRSLTERLYIGGPLTNSKGQNCGYRRCRASGVLTTSCGNTLTCYLKASAACRAAKLQDCTMLVNGDDLVVICESAGTQEDAERLRAFTEAMTRYSAPPGDPPQPEYDLELITSCSSNVSVAHDASGKRVYYLTRDPTTPLARAAWETARHTPVNSWLGNIIMYAPTLWARMILMTHFFSILLAQEQLEKALDCQIYGACYSIEPLDLPQIIERLHGLSAFSLHSYSPGEINRVASCLRKLGVPPLRVWRHRARSVRAKLLSQGGRAATCGKYLFNWAVRTKLKLTPIPAASRLDLSGWFVAGYSGGDIYHSLSRARPRWFMLCLLLLSVGVGIYLLPNR

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 • 673 views
ADD COMMENTlink modified 3.7 years ago by Asaf7.3k • written 3.7 years ago by riaasuddin0
1
gravatar for Asaf
3.7 years ago by
Asaf7.3k
Israel
Asaf7.3k wrote:
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 COMMENTlink written 3.7 years ago by Asaf7.3k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1783 users visited in the last hour