! /bin/bash
$ -l mem=30G,time=50::
$ -j y
$ -N bam2fq
$ -cwd
source ~/.bashrc
in_dir=/ifs/data/dipg_cbttc_bam
out_dir=/ifs/data/dipg_cbttc_fastq
mkdir $out_dir
for fullpath in "$in_dir"/*
do
filename="{fullpath:0:{#filename}}" # Substring from 0 thru pos of filename
base="{filename:${#base} + 1}"
echo dir
echo ext
java -Xmx2g -jar /ifs/scratch/picard.jar SamToFastq I={out_dir}/{out_dir}/${base}_R2.fastq
samtools bam2fq {out_dir}/${base}.fastq
done
网友评论