Question: run picard on all bam files in directory
0
gravatar for bioguy24
3.6 years ago by
bioguy24180
Chicago
bioguy24180 wrote:

I am trying to run a bash loop on all bam files in a directory and having a bit of trouble.  The bash so far as well as the individual picard command is below.  Thank you :).

Bash loop so far

for f in /home/cmccabe/Desktop/NGS/pool_I_090215/*.bam ; do
bname=`basename $f`
pref=${bname%%.bam}
java -jar /home/cmccabe/Desktop/NGS/picard-tools-1.139/picard.jar CalculateHsMetrics BI=/home/cmccabe/Desktop/NGS/bed/sam_sorted_unix_5column_xgen_probes.bed TI=/home/cmccabe/Desktop/NGS/bed/sam_sorted_unix_5column_xgen_targets.bed I=/$f O=/home/cmccabe/Desktop/NGS/pool_I_090215/${pref}_all_IDT.CalculateHSmetrics
done

If the bam files were run individually here is the command

java -jar /home/cmccabe/Desktop/NGS/picard-tools-1.139/picard.jar CalculateHsMetrics BI=/home/cmccabe/Desktop/NGS/bed/sam_sorted_unix_5column_xgen_probes.bed TI=/home/cmccabe/Desktop/NGS/bed/sam_sorted_unix_5column_xgen_targets.bed I=/home/cmccabe/Desktop/NGS/pool_II_090115/IonXpress_015_150901_newheader.bam  O=/home/cmccabe/Desktop/NGS/pool_II_090115/IonXpress_015_150901_all_IDT.CalculateHSmetrics

 

bam picard ngs • 1.5k views
ADD COMMENTlink modified 3.6 years ago by Dan D6.7k • written 3.6 years ago by bioguy24180

what is the problem ? what is the question ?

ADD REPLYlink written 3.6 years ago by Pierre Lindenbaum119k

What error message are you getting?

ADD REPLYlink written 3.6 years ago by Alex Reynolds28k

Are you sharing this as a useful tip, cmccabe ?

ADD REPLYlink written 3.6 years ago by RamRS21k
0
gravatar for Dan D
3.6 years ago by
Dan D6.7k
Tennessee
Dan D6.7k wrote:

Some of the problems I see:

  • You're specifying parameters in an abbreviated fashion. TI should be TARGET_INTERVALS, for example.
  • The tool doesn't use BED format for the intervals files. It uses its own interval list format.
  • The output for each sample is being written to the same output file. That means you'll be overwriting it each time.

You should at minimum clearly state a question/problem  and provide any error output that you obtain from the tool.

ADD COMMENTlink modified 3.6 years ago • written 3.6 years ago by Dan D6.7k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 790 users visited in the last hour