Commit 515d72a6 authored by mirandaa's avatar mirandaa
Browse files

feat: fragments

parent 26c844be
......@@ -130,22 +130,38 @@ def main():
line1 = f'#Identify {args.compound}#'
line2 = f'QUERYNAME = {args.compound};'
line3 = f"DEFINE pr = '{ec}' WITH DBR = ({dbe_low},{dbe_high}), CHG = {ms}1;"
for frag in frags_txt:
do something here
line4 = f'IDENTIFY\n\tpr in MS1{ms}'
line5 = f'SUCHTHAT\n\t{such}(pr.chemsc[H]) AND \n\tisOdd(pr.chemsc[db]*2)'
line6 = f'REPORT\n\tPRM = pr.mass;\n\tEC = pr.chemsc;\n\tCLASS = "{args.compound}" % "()";\n\tQSERR = "%2.2f" % "(pr.errppm)";\n\tQS = pr.intensity;;'
lines3x =[]
for idx,fragment in enumerate(frags_txt):
lines3x.append(
f"DEFINE fr{idx} = "
f"'{fragment}' WITH "
f"DBR = ({dbes[idx][0]},{dbes[idx][1]}),"
f" CHG = {ms}1;")
line4 = f'\n\nIDENTIFY\n\tpr in MS1{ms}'
lines4x =[]
for idx,_ in enumerate(frags_txt):
lines4x.append(f"\t AND fr{idx} in MS2{ms}")
line5 = f'\n\nSUCHTHAT\n\t{such}(pr.chemsc[H]) AND \n\tisOdd(pr.chemsc[db]*2)'
line6 = f'\nREPORT\n\tPRM = pr.mass;\n\tEC = pr.chemsc;\n\tCLASS = "{args.compound}" % "()";\n\tQSERR = "%2.2f" % "(pr.errppm)";\n\tQS = pr.intensity;'
lines6x =[]
for idx,_ in enumerate(frags_txt):
lines6x.append(f"\tfr{idx} = fr{idx}.intensity;")
lineLast =';'
filename = os.path.join(args.mfql_dir, args.compound + '.mfql')
with open(filename, 'w') as f:
f.write(line1 + '\n')
f.write(line2 + '\n')
f.write(line3 + '\n')
f.write('\n'.join(lines3x))
f.write(line4 + '\n')
f.write('\n'.join(lines4x))
f.write(line5 + '\n')
f.write(line6 + '\n')
f.write('\n'.join(lines6x))
f.write(lineLast + '\n')
if __name__ == "__main__":
main()
......
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