Skip to content

Commit

Permalink
Merge pull request #282 from RoanKanninga/master
Browse files Browse the repository at this point in the history
bugfix: coveragePerTarget other than capturingKit are not shown in th…
  • Loading branch information
Gerbenvandervries authored Mar 18, 2022
2 parents ce4d5a9 + 3a3e6e7 commit c68b2a4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 37 deletions.
3 changes: 1 addition & 2 deletions batchIDList_chr.csv
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ batchID
20
21
22
Xp
Xnp
X
Y
MT
NC_001422.1
10 changes: 4 additions & 6 deletions protocols/CoverageCalculations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ then
-T DepthOfCoverage \
-o "${sampleNameID}.${perTarget}.coveragePerTarget" \
-I "${dedupBam}" \
-mmq 20 \
-mmq 20 \
--omitDepthOutputAtEachBase \
-L "${perTargetDir}/${perTarget}.interval_list"

Expand Down Expand Up @@ -127,18 +127,16 @@ then
if [ $count == 0 ]
then
percentage=0

else
percentage=$(echo $((count*100/totalcount)))
if [ ${percentage%%.*} -gt 10 ]
then
echo "${sampleNameID}: percentage $percentage ($count/$totalcount) is more than 10 procent, skipped"
echo "${sampleNameID}: percentage $percentage ($count/$totalcount) is more than 10 procent, skipped" >> "${projectResultsDir}/coverage/${externalSampleID}.rejected"
else
rsync -a "${sampleNameID}.${perTarget}.coveragePerTarget.txt" "${projectResultsDir}/coverage/CoveragePerTarget/${Gender,,}/"
echo "WARNING: ${sampleNameID}: percentage $percentage ($count/$totalcount) is more than 10 procent"
echo "WARNING: ${sampleNameID}: percentage $percentage ($count/$totalcount) is more than 10 procent" >> "${projectResultsDir}/coverage/${externalSampleID}.rejected"
fi
fi
fi
rsync -a "${sampleNameID}.${perTarget}.coveragePerTarget.txt" "${projectResultsDir}/coverage/CoveragePerTarget/${Gender,,}/"
done
else
echo "There are no CoveragePerTarget calculations for this bedfile: ${bedfile}"
Expand Down
2 changes: 1 addition & 1 deletion protocols/GenderCalculate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

module load "${picardVersion}"

if [[ "${capturedIntervals}" == *"ONCO_v"* || "${capturedIntervals}" == *"wgs"* || "${capturedIntervals}" == *"Targeted_v"*]]
if [[ "${capturedIntervals}" == *"ONCO_v"* || "${capturedIntervals}" == *"wgs"* || "${capturedIntervals}" == *"Targeted_v"* ]]
then
touch "${dedupBamMetrics}.noChrX"
else
Expand Down
45 changes: 17 additions & 28 deletions protocols/VariantCalling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@

#Function to check if array contains value
array_contains () {
local array="$1[@]"
local seeking=$2
local in=1
for element in "${!array-}"; do
if [[ "${element}" == "${seeking}" ]]; then
in=0
break
fi
done
return "${in}"
local array="$1[@]"
local seeking="${2}"
local in=1
for element in "${!array-}"; do
if [[ "${element}" == "${seeking}" ]]; then
in=0
break
fi
done
return "${in}"
}

#Load GATK module
Expand All @@ -47,7 +47,7 @@ bams=()
INPUTS=()
for sampleID in "${externalSampleID[@]}"
do
array_contains INPUTS "${sampleID}" || INPUTS+=("$sampleID") # If bamFile does not exist in array add it
array_contains INPUTS "${sampleID}" || INPUTS+=("$sampleID") # If bamFile does not exist in array add it
done
baitBatchLength=""
sex=$(less "${projectResultsDir}/general/${externalSampleID}.chosenSex.txt" | awk 'NR==2')
Expand All @@ -68,33 +68,22 @@ else
genderCheck="Male"
fi

ploidy=""
ploidy='2'
myBed="${capturedBatchBed}"
if [[ ! -f "${capturedBatchBed}" || ${baitBatchLength} -eq 0 ]]
then
echo "skipped ${capturedBatchBed}, because the batch is empty or does not exist"
else
if [ "${genderCheck}" == "Female" ]
if [[ "${capturedBatchBed}" == *batch-[0-9]*Y.bed || "${capturedBatchBed}" == *batch-Y.bed ]]
then
if [[ "${capturedBatchBed}" == *batch-[0-9]*Y.bed || "${capturedBatchBed}" == *batch-Y.bed ]]
if [ "${genderCheck}" == "Female" ]
then
echo -e "Female, chrY => ploidy=1\nbedfile=${femaleCapturedBatchBed}"
ploidy=1
echo "female, Y"
myBed="${femaleCapturedBatchBed}"
else
echo -e "Female, autosomal or chrX ==> ploidy=2"
ploidy=2
fi
elif [[ "${genderCheck}" == "Male" ]]
then
if [[ "${capturedBatchBed}" == *batch-[0-9]*Y.bed || "${capturedBatchBed}" == *batch-Y.bed || "${capturedBatchBed}" == *batch-Xnp.bed ]]
then
ploidy=1
echo -e "Male, chrY or chrXNonPar ==> ploidy=1"
else
ploidy=2
echo -e "Male, autosomal or chrXPar ==> ploidy=2"
echo "male, Y"
fi
ploidy=1
fi

java -XX:ParallelGCThreads=1 -Djava.io.tmpdir="${tempDir}" -Xmx7g -jar \
Expand Down

0 comments on commit c68b2a4

Please sign in to comment.