c7653932e0efd97ebcb24e459434fbbeb28a1e97 kuhn Thu May 29 08:41:03 2014 -0700 added 54844 to chromsizes file as suggested by Jonathan. Refs #13331 diff --git src/utils/qa/bamToBigWig.csh src/utils/qa/bamToBigWig.csh index 44a2bba..013a804 100755 --- src/utils/qa/bamToBigWig.csh +++ src/utils/qa/bamToBigWig.csh @@ -1,60 +1,60 @@ #!/bin/tcsh ############################################### # # 05-22-2014 # Robert Kuhn # # convert a BAM file to bigWig # ############################################### onintr cleanup set db="" set bamFile="" set bwFile="" if ( $#argv == 0 || $#argv > 4 ) then # no command line args echo echo " convert a BAM file into a bigWig" echo " requires bedtools" echo echo " usage: db in.bam out.bw [splitByStrand]" echo " where splitByStrand makes two output files" echo exit endif set db=$argv[1] set bamFile=$argv[2] set bigWigFile=$argv[3] # if bigwig file has .bw on the end, remove so can add plus/minus before .bw set bigWigFile=`echo $bigWigFile | sed s/.bw\$//` -fetchChromSizes $db > $db.chromsizes +fetchChromSizes $db > $db.chromsizes$$ if ( $#argv == 4 ) then if ( $argv[4] == "splitByStrand" ) then bamToBedGraph.csh $db $bamFile $bamFile.bedgraph splitByStrand - bedGraphToBigWig $bamFile.bedgraph.plus $db.chromsizes $bigWigFile.plus.bw - bedGraphToBigWig $bamFile.bedgraph.minus $db.chromsizes $bigWigFile.minus.bw + bedGraphToBigWig $bamFile.bedgraph.plus $db.chromsizes$$ $bigWigFile.plus.bw + bedGraphToBigWig $bamFile.bedgraph.minus $db.chromsizes$$ $bigWigFile.minus.bw else echo echo ' 4th argument can only be: "splitByStrand"' $0 exit endif else bamToBedGraph.csh $db $bamFile $bamFile.bedgraph - bedGraphToBigWig $bamFile.bedgraph $db.chromsizes $bigWigFile.bw + bedGraphToBigWig $bamFile.bedgraph $db.chromsizes$$ $bigWigFile.bw endif cleanup: -rm -f $db.chromsizes +rm -f $db.chromsizes$$ rm -f $bamFile.bedgraph.plus rm -f $bamFile.bedgraph.minus rm -f $bamFile.bedgraph