You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed using bedshift recently that the algorithm seems to produce regions that are invalid. Specifically, it shifted my bedfile to create a region with a start that occurred after the end (i.e. chr1 1400 900). bedtools was throwing errors because of this.
I saw this happen after I did repeated rounds of shifting on a single bedfile so I'm not sure if this is because of that.
To create the shifted bed files, this is what I ran (I can provide filesm GitHub doesn't let you upload bedfiles):
# %%importosfromtqdmimporttqdmfrombedshiftimportBedshift# %%# paramsADD_RATE=0.01ADD_MEAN=320.0ADD_STDEV=20.0SHIFT_RATE=0.01SHIFT_MEAN=-10.0SHIFT_STDEV=120.0CUT_RATE=0.01MERGE_RATE=0.01DROP_RATE=0.03N_SHIFTS=100OUT_DIR="shifted"# %%# create bedshifter object on original bed filebedshifter=Bedshift("pbmcs.bed", "hg38.chrom.sizes")
forshift_numintqdm(range(N_SHIFTS), total=N_SHIFTS):
file_name=f"shifted_{shift_num}.bed"file_path=os.path.join(OUT_DIR, file_name)
bedshifter.all_perturbations(
addrate=ADD_RATE, # the rate (as a proportion of the total number of regions) to add regionsaddmean=ADD_MEAN, # the mean length of added regionsaddstdev=ADD_STDEV, # the standard deviation of the length of added regionsshiftrate=SHIFT_RATE, # the rate to shift regions (both the start and end are shifted by the same amount)shiftmean=SHIFT_MEAN, # the mean shift distanceshiftstdev=SHIFT_STDEV, # the standard deviation of the shift distancecutrate=CUT_RATE, # the rate to cut regions into two separate regionsmergerate=MERGE_RATE, # the rate to merge two regions into onedroprate=DROP_RATE, # the rate to drop/remove regionsseed=42,
)
bedshifter.to_bed(file_path)
# start at the file we just createdbedshifter=Bedshift(file_path, "hg38.chrom.sizes")
Then I analyzed overlaps with bedtools with (one directory up):
I noticed using
bedshift
recently that the algorithm seems to produce regions that are invalid. Specifically, it shifted my bedfile to create a region with a start that occurred after the end (i.e.chr1 1400 900
).bedtools
was throwing errors because of this.I saw this happen after I did repeated rounds of shifting on a single bedfile so I'm not sure if this is because of that.
To create the shifted bed files, this is what I ran (I can provide filesm GitHub doesn't let you upload bedfiles):
Then I analyzed overlaps with
bedtools
with (one directory up):The text was updated successfully, but these errors were encountered: