Question: Help required in Perl Script
0
gravatar for riaasuddin
2.9 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 • 563 views
ADD COMMENTlink modified 2.9 years ago by Asaf5.6k • written 2.9 years ago by riaasuddin0
1
gravatar for Asaf
2.9 years ago by
Asaf5.6k
Israel
Asaf5.6k 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 2.9 years ago by Asaf5.6k
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: 1125 users visited in the last hour