Skip to content
Snippets Groups Projects
Commit 829a6187 authored by Gervaise Henry's avatar Gervaise Henry :cowboy:
Browse files

Update naming convention in dataQC

parent 55cf5ff7
Branches
Tags
2 merge requests!58Develop,!53Resolve "process_derivaUpload"
......@@ -1133,8 +1133,8 @@ process dataQC {
val ends from endsInfer_dataQC
output:
path "${repRID}.tin.hist.tsv" into tinHist
path "${repRID}.tin.med.csv" into tinMedInfer_fl
path "${repRID}_tin.hist.tsv" into tinHist
path "${repRID}_tin.med.csv" into tinMedInfer_fl
path "${repRID}.insertSize.inner_distance_freq.txt" into innerDistance
script:
......@@ -1157,12 +1157,12 @@ process dataQC {
if [ "${ends}" == "pe" ]
then
echo -e "LOG: calculating inner distances for ${ends}" >> ${repRID}.dataQC.log
inner_distance.py -i "${bam}" -o ${repRID}.insertSize -r ./bed/genome.bed
inner_distance.py -i "${bam}" -o ${repRID}_insertSize -r ./bed/genome.bed
echo -e "LOG: calculated" >> ${repRID}.dataQC.log
elif [ "${ends}" == "se" ]
then
echo -e "LOG: creating dummy inner distance file for ${ends}" >> ${repRID}.dataQC.log
touch ${repRID}.insertSize.inner_distance_freq.txt
touch ${repRID}_insertSize.inner_distance_freq.txt
fi
"""
}
......
......@@ -17,7 +17,7 @@ def get_args():
def main():
args = get_args()
tin = pd.read_csv(args.repRID + '.sorted.deduped.tin.xls',
tin = pd.read_csv(args.repRID + '_sorted.deduped.tin.xls',
sep="\t", header=0)
hist = pd.cut(tin['TIN'], bins=pd.interval_range(
......@@ -42,8 +42,8 @@ def main():
hist = hist[['TOTAL'] + [i for i in hist.columns if i != 'TOTAL']]
hist = hist.T.fillna(0.0).astype(int)
#hist = hist.apply(lambda x: x/x.sum()*100, axis=1)
hist.to_csv(args.repRID + '.tin.hist.tsv', sep='\t')
medFile = open(args.repRID + '.tin.med.csv', "w")
hist.to_csv(args.repRID + '_tin.hist.tsv', sep='\t')
medFile = open(args.repRID + '_tin.med.csv', "w")
medFile.write(str(round(tin['TIN'][(tin['TIN'] != 0)].median(), 2)))
medFile.close()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment