|
- import pandas as pd
- import sys, argparse, os
-
-
- # input arguments
- parser = argparse.ArgumentParser(description="This script is to get 1500bp surround SV breakpoint,")
-
- parser.add_argument('-SV', '--SV_bed_file', type=str, help='The SV breakpoint bed file', required=True)
- parser.add_argument('-prefix', '--prefix', type=str, help='The prefix of output file', required=True)
-
-
- args = parser.parse_args()
- SV = args.SV_bed_file
- prefix = args.prefix
-
-
- sv = pd.read_table(SV,header=None)
- # left
- for i in range(50,1550,50):
- sv.iloc[:,2] = sv.iloc[:,1]
- sv.iloc[:,1] = sv.iloc[:,1] - 50
- file_name = prefix + '.' + str(i) + '.left.bed'
- sv.to_csv(file_name,sep="\t",index=0,header=None)
-
-
- sv = pd.read_table(SV,header=None)
- # right
- for i in range(50,1550,50):
- sv.iloc[:,1] = sv.iloc[:,2]
- sv.iloc[:,2] = sv.iloc[:,2] + 50
- file_name = prefix + '.' + str(i) + '.right.bed'
- sv.to_csv(file_name,sep="\t",index=0,header=None)
|