Пример #1
0
def test_swap_charge():
    out = swap_charge(ref_mol2, fix_mol2, template_col=-1, target_col=-1)
    assert('\n'.join(out) == result)
Пример #2
0
    quit()
if not args.input2:
    print('Please provide an input file via the -i2 flag. Use --help for more information.\n') 
    quit()




# get mol2 in line list format
ref_mol2 = split_multimol2(args.input1)
ref_mol2 = next(ref_mol2)[1].split('\n')

fix_mol2 = split_multimol2(args.input2)
fix_mol2 = next(fix_mol2)[1].split('\n')



# apply the charge fix
out_cont = swap_charge(
        template_mol2=ref_mol2,
        target_mol2=fix_mol2,
        template_col=args.reference_column,
        target_col=args.target_column
        )

if args.output:
    with open(args.output, 'w') as out_file:
        out_file.write('\n'.join(out_cont))
else:
    print('\n'.join(out_cont))