Commit b6b36131 authored by peguerin's avatar peguerin
Browse files

argparse system and many markers

parent 3597a58f
import pandas
import sys
import argparse
import os
datFile='Teleo.dat'
aliceFile='cor_tag_teleo.csv'
#datFile='Teleo.dat'
#aliceFile='cor_tag_teleo.csv'
#projetName='notreProjet'
parser = argparse.ArgumentParser(description='prepare rapidrun allsamples CSV file')
parser.add_argument("-d","--datFolder", type=str, help="Folder of the dat files")
parser.add_argument("-a","--aliceFile", type=str, help="CSV Alice file")
parser.add_argument("-p","--projetName", type=str, help="name of the project")
args = parser.parse_args()
datFolder = args.datFolder
aliceFile = args.aliceFile
projetName = args.projetName
datFolder='resources/test/test_rapidrun_data/ngs/rapidrun_metadata/'
datFolderList = os.listdir(datFolder)
datFiles = {}
for fichier in datFolderList:
if ".dat" in fichier:
datMarker = fichier.split(".")[0].lower()
datFiles[datMarker]= datFolder+"/"+fichier
datDic = {}
for key in datFiles:
datDic[key] = pandas.read_csv(datFiles[key], sep='\t', names=["plaque", "plaque1", "tag", "primerF","primerR", "description"])
###############################################################################
......@@ -10,7 +36,6 @@ aliceFile='cor_tag_teleo.csv'
alice = pandas.read_csv(aliceFile, sep=';')
dat = pandas.read_csv(datFile, sep='\t', names=["plaque", "plaque1", "tag", "primerF","primerR", "description"])
uniqMarkers=alice.marker.unique()
for marker in uniqMarkers:
......@@ -32,11 +57,11 @@ for marker in uniqMarkers:
plaque = dat['plaque'][i]
sample = aliceRun['Sample'][j]
if "SPY" in sample:
projet="notreProjet"
elif "Other" in sample:
projet=projetName
elif "Other" in sample or "OTHER" in sample or "Other" in sample:
projet="Other"
else:
projet="notreProjet"
projet=projetName
print(plaque, run, sample, projet, marker, sep=";")
break
if not in_alice:
......
Markdown is supported
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