字符串处理问题,来帮帮忙....

字符串处理问题,来帮帮忙....

字符串处理问题,来帮帮忙....
如:
$seq=atctatgctgttttatttatcttcccaacctgattggcagctagacttttttagggtctcatttaatggccctgtttttttcattattatatttaatgatagggcaggatttcgtatgcaagctcttgtttctcaggctgcctgcagaagaagtcgctataaattatctgttgtctacatggtacaaggcccattgactcatctgatgcttgttttgttaatttctttaatatttttatcacggggcagtgggagggcttgggcttttagccacagctgttttaagacttctgatctcctgccctgcaggaataggtgggaagtcattgaatttttacactatagtaatttgcattcccacataagtttgagtgttacgaaaacattcctttaaagggatctgtgctacacaaaatatgccaggacctcacagacaaagccattgctagaaatgtcattccaatgatcagatctggaaacaggctgccataaccacttttccttcttgtagactcagctcacctgtatatttaaactgttcttggcatcttgaaacacctatttctactcaggtactcattgtcctgttactgattcacctttctgatccttttcaaccagttttcccccaaggggggaaattttacttaacctctagtatttgaacaactcaatatttgaattgttgccccatttgcttttacctgtactgtattcttggtcatctcaaatggcgtctaaacccagctactttgcattccagaagtttccattccctccaattccacctaatttttcatctgtcctagttactggctctttcttcatgtcttatttctcttgctttgggagcttaaaagattttacaagacctaattttgggttccttccttggagccatagttaccctgccaagaagagtagaaaatgggttcaactcctgtttcgctccaccaacacctctgtgactcgag

$cds_sart=5
$cds_stop=394

如何截取从5到394的这段序列呢?
噢,学会了~~--$seq=subs.
噢,学会了~~
$seq=substr($seq,$cds_start-1,$cds_stop-$cds_start+1);
如果处理 基因/蛋白 序列文件,建议还是用 bioperl 处理较好。

如,处理序列的子串

$subseq = $seq->subseq(5,394)