You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
920B

  1. import pandas as pd
  2. import sys, argparse, os
  3. # input arguments
  4. parser = argparse.ArgumentParser(description="This script is to get 1500bp surround SV breakpoint,")
  5. parser.add_argument('-SV', '--SV_bed_file', type=str, help='The SV breakpoint bed file', required=True)
  6. parser.add_argument('-prefix', '--prefix', type=str, help='The prefix of output file', required=True)
  7. args = parser.parse_args()
  8. SV = args.SV_bed_file
  9. prefix = args.prefix
  10. sv = pd.read_table(SV,header=None)
  11. # left
  12. for i in range(50,1550,50):
  13. sv.iloc[:,2] = sv.iloc[:,1]
  14. sv.iloc[:,1] = sv.iloc[:,1] - 50
  15. file_name = prefix + '.' + str(i) + '.left.bed'
  16. sv.to_csv(file_name,sep="\t",index=0,header=None)
  17. sv = pd.read_table(SV,header=None)
  18. # right
  19. for i in range(50,1550,50):
  20. sv.iloc[:,1] = sv.iloc[:,2]
  21. sv.iloc[:,2] = sv.iloc[:,2] + 50
  22. file_name = prefix + '.' + str(i) + '.right.bed'
  23. sv.to_csv(file_name,sep="\t",index=0,header=None)