[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] perl



On Apr 18, 2012, at 12:30 PM, Klinkebiel, David L wrote:
> I have files that are in this tab delimited format:
> Chromosome    Position   Strand
> chr1      1202020    R
> chr2      27263453   F
> etc.
> I need a perl that will convert them to the following format:
> chr       Start    End
> chr1   1202020  End would be Start+50 bases so =1202070
> chr2   27263453   27263503

Except for the headers, this program does that:

   perl -anE 'say join "\t", @F[0,1], $F[1] + 50' inputfile.txt

But is it safe to ignore the strand here? Isn't your start and end different depending on Strand being F or R?

I hope that helps,

j