Skip to content

Commit

Permalink
filtering out augmented contigs from TE predictions in TEMP2
Browse files Browse the repository at this point in the history
  • Loading branch information
pbasting committed Apr 19, 2021
1 parent 40863ac commit a393b73
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/temp2/temp2_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def main():
if prev_steps_succeeded:
insertions = read_insertions(insert_bed, sample_name, chromosomes, config)
absence_bed = make_absence_bed(absence_summary, sample_name, out_dir)
non_absent_ref_insertions = get_non_absent_ref_tes(te_gff, absence_bed, sample_name, out_dir, log)
non_absent_ref_insertions = get_non_absent_ref_tes(te_gff, absence_bed, sample_name, chromosomes, out_dir, log)
insertions += non_absent_ref_insertions

if len(insertions) > 0:
Expand Down Expand Up @@ -105,7 +105,7 @@ def make_absence_bed(summary_file, sample, out):

return out_bed

def get_non_absent_ref_tes(te_gff, absence_bed, sample, out, log):
def get_non_absent_ref_tes(te_gff, absence_bed, sample, chromosomes, out, log):
insertions = []
tmp_gff = out+"/tmp.ref_nonabs.gff"
command = ["bedtools", "subtract", "-A", "-a", te_gff, "-b", absence_bed]
Expand All @@ -124,7 +124,8 @@ def get_non_absent_ref_tes(te_gff, absence_bed, sample, out, log):
insert.strand = split_line[6]
insert.type = "reference"

insertions.append(insert)
if insert.chromosome in chromosomes:
insertions.append(insert)

mccutils.remove(tmp_gff)

Expand Down

0 comments on commit a393b73

Please sign in to comment.