-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommand_template.txt
More file actions
26 lines (26 loc) · 1.83 KB
/
Copy pathcommand_template.txt
File metadata and controls
26 lines (26 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
dx download {project_id}:{input_file_id} &&
outname="{output_file_name}" &&
echo "output name is $outname" &&
file_wo_prefix=${{outname#*_}} &&
echo $file_wo_prefix &&
bcftools annotate -x ^FORMAT/GT,^FORMAT/GQ,^FORMAT/LAD -Ou {input_file_name} |
bcftools +setGT --output-type u -- -t q -i "FMT/GQ<=10 | smpl_sum(FMT/LAD)<7" -n . |
bcftools filter --output-type u -e "F_MISSING > 0.1" |
bcftools filter --soft-filter HWE_FAIL -e "INFO/HWE <= 1e-15" --output-type b -o "$file_wo_prefix" &&
echo "File done: $file_wo_prefix" &&
rm -v {input_file_name} &&
echo "Second filtering of bcf file" &&
bcftools +setGT --output-type u "$file_wo_prefix" -- -t q -i "(FMT/GT=\\"het\\" & (binom(FMT/LAD)<=0.001)) | smpl_sum(FMT/LAD)<10" -n . |
bcftools filter --output-type u -e "FILTER='HWE_FAIL' | F_MISSING > 0.1" | bcftools annotate -x 'INFO,FORMAT' --output-type b4 -o "filtered_$file_wo_prefix" &&
mv -v "filtered_$file_wo_prefix" /home/dnanexus/out/output_files &&
echo "File done: filtered_$file_wo_prefix" &&
echo "Filtering for 5k samples" &&
bcftools view --force-samples --samples-file /cardinal_5k_samples.txt --min-ac 1 --output-type b4 "$file_wo_prefix" -o "5k_$file_wo_prefix" &&
mv -v "5k_$file_wo_prefix" /home/dnanexus/out/output_files &&
output_file_filtered=$(dx upload "/home/dnanexus/out/output_files/filtered_$file_wo_prefix" --brief) &&
dx-jobutil-add-output output_files "$output_file_filtered" --class=array:file &&
echo "File uploaded: filtered_$file_wo_prefix $output_file_filtered" &&
output_file_5k=$(dx upload "/home/dnanexus/out/output_files/5k_$file_wo_prefix" --brief) &&
dx-jobutil-add-output output_files "$output_file_5k" --class=array:file &&
echo "File done: {output_file_name} $output_file_5k"
rm -v "/home/dnanexus/out/output_files/5k_$file_wo_prefix" "$file_wo_prefix" "/home/dnanexus/out/output_files/filtered_$file_wo_prefix"