[BiO BB] perl help
Dan Bolser
dmb at mrc-dunn.cam.ac.uk
Tue Nov 18 12:52:46 EST 2003
not sure about the genbank format, but could you do something like
while(<>){ # itterate through file given on command line...
if (/^ORIGIN(.*)/){
$sequence .= $1;
}
}
$rand = rand( length($sequence) );
substr ( $rand, 100, $sequence) );
Matt McCormick said:
> Please allow me to elaborate a bit more. I'm trying to pull a random 100 kb
> section from the chromosomal sequence(in genbank format,
> Accession NC_003070). The chromosome sequence is 30494425 bp long, and the
> positions x and y represent the base i want my sequence to start and end
> respectively. I'm just beginning to use perl, and for me to use substr function,
> i would have to find and join all the lines starting at the ORIGIN. I m not sure
> on the best way to do this. Any help would be appreciated. Thank you.
>
>
> On Sat, 2003-11-15 at 19:47, Joe Landman wrote:
>> Hi Matt:
>>
>>
>> On Sat, 2003-11-15 at 19:33, Matt McCormick wrote:
>> > Hi,
>> > I am trying to construct a sequence, with start position x and end position y,
>> from A.thaliana chromosome 1. Does anyone have any code they would be willing
>> to share that would do this? I have the current perl and bioperl modules
>> installed. Thank you.
>>
>> I might suggest giving a better specification of the problem. You
>> have the chromosome 1 data in some format, and you need to extract a particular
>> section from it? If this is the case, then is there a particular reason why the
>> substr function will not work?
>>
>> my $small = substr $sequence,$x,$y-$x+1 ;
>>
>> Joe
>>
>> >
>> > -Matt McCormick
>> >
>> >
>> > _______________________________________________
>> > BiO_Bulletin_Board maillist - BiO_Bulletin_Board at bioinformatics.org
>> https://bioinformatics.org/mailman/listinfo/bio_bulletin_board
>
>
> _______________________________________________
> BiO_Bulletin_Board maillist - BiO_Bulletin_Board at bioinformatics.org
> https://bioinformatics.org/mailman/listinfo/bio_bulletin_board
More information about the BBB
mailing list