#!/usr/bin/perl #=============================================================================== # # FILE: tranMappedJuncReads.pl # # USAGE: ./tranMappedJuncReads.pl # # DESCRIPTION: Translate the mapped short reads to the reference genome using # bowtie to the mapping format needed by IsoInfer # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Jianxing Feng (feeldead), feeldead@gmail.com # COMPANY: THU # VERSION: 1.0 # CREATED: 05/29/2010 10:39:52 PM # REVISION: --- #=============================================================================== if( @ARGV < 1 ){ die("Usage: ./tranMappedJuncReads.pl \n"); } $read_len = $ARGV[0]; while () { chomp; @tmp = split(/\t/); @junc = split(/\|/, $tmp[2]); $cross_len = $junc[3]; $cross_strengh = $read_len - $cross_len; $junc_first_end = $junc[1] + $cross_len; $junc_second_start = $junc[2]; $chr = $junc[0]; $strand = $tmp[1]; $first_start = $tmp[3] + $junc[1]; $second_end = $junc_second_start + $tmp[3] + $cross_strengh; print "$chr\t$strand\t$first_start,$junc_second_start\t$junc_first_end,$second_end\n"; }