Mercurial > repos > jasmine_amir > snrqk
view SNRQK.py @ 1:b3e3fa1f38c1
"planemo upload commit 35c3f891d1e30692c21c2289167b6eab47fcba83"
author | jasmine_amir |
---|---|
date | Fri, 22 Apr 2022 22:44:49 -0400 |
parents | 5960f43113c6 |
children | 98f4e5f40400 |
line wrap: on
line source
#!/usr/bin/env python3 # coding: utf-8 ########################################################### ########################################################### ## Jasmine Amirzadegan ## 2022 APRIL 14 ########################################################### ## SNRQC.py: ## compute QC metrics specific to SSQuAWK v4 + workflows ## usage: python SNRQC.py intermediateSSQuAWKfile.txt ## python 3.7 ########################################################### import pandas as pd import sys fn = sys.argv[1] df = pd.read_csv(fn, sep = "\t", header = 0) if (df['Sample'].str.contains('negativeControl')).any(): m = df.loc[ (df['Sample'].str.contains('negativeControl')) ] noise = m['readsAlignPassFilt'] SNR = [] for i in df['readsAlignPassFilt']: SNR.append(i/noise.item()) #[float(j) for j in SNR] df['SNR'] = SNR else: df['SNR'] = "NA" #print(df) #fn1 = fn.split("/")[1] #df.to_csv('test-data/snrqk_result' + fn1 + '.tsv', sep="\t") df.to_csv('snrqk_result.tsv', sep='\t')