Commit ffb634d9 authored by Eric CHARPENTIER's avatar Eric CHARPENTIER 🐍
Browse files

fixed bug in config2inputs

parent c2de6be7
......@@ -15,17 +15,16 @@ parser.add_argument('-p', '--project', metavar='PROJECT_NAME',help='keeps only t
args = parser.parse_args()
d = json.load(args.config)
fieldnames = ("well","index","name","project","condition","species","factor")
if(args.project is not None):
samples = [s for s in d["samples"] if s["project"] == args.project]
else:
samples = d["samples"]
writer = csv.DictWriter(args.samplesheet, fieldnames=fieldnames, delimiter='\t')
writer.writerows(samples)
fieldnames = ("well","index","name","project","condition","species","factor")
for s in d["samples"]:
args.samplesheet.write(s["well"]+"\t"+s["index"]+"\t"+s["name"]+"\t"+s["project"+"\t"+s["condition"]+"\t"+s["species"])
if (s["factor"] is not None):
args.samplesheet.write("\t"+s["factor"])
args.samplesheet.write("\n")
for c in d["comparisons"]:
if(args.project is not None and not c==args.project):
......
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