Skip to content

Commit

Permalink
Changed splice junction evidence decision tree
Browse files Browse the repository at this point in the history
Hierarchy of splice junction evidence:
1. --reference and --splice files
2. --genome sequence motifs
3. XS and ts tags from BAM/SAM input
  • Loading branch information
maschon0 committed Jun 1, 2023
1 parent ffc6c35 commit ae15f57
Show file tree
Hide file tree
Showing 42 changed files with 13,761 additions and 8,333 deletions.
3 changes: 3 additions & 0 deletions bookend/core/assemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ def __init__(self, args):
'sj':None,
}
config.update(long_defaults)
elif self.input_file.header.get("HD",{}).get("SO",'unsorted') != 'coordinate':
print("ERROR: BAM input reads must be sorted by coordinate.")
sys.exit(1)

self.dataset = RNAseqDataset(chrom_array=self.input_file.header.references, config=config)
elif self.file_type == 'elr.gz':
Expand Down
5 changes: 4 additions & 1 deletion bookend/core/bam_to_elr.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
class BAMtoELRconverter:
def __init__(self, args):
"""Parses input arguments for converting BAM to ELR"""
print(args)
self.source = args['SOURCE']
self.genome = args['GENOME']
self.reference = args['REFERENCE']
Expand Down Expand Up @@ -139,6 +138,10 @@ def __init__(self, args):
if self.source is None:
self.source = self.bam_in.header['PG'][0]['ID']

if self.bam_in.header.get("HD",{}).get("SO",'unsorted') == 'coordinate':
print("WARNING: BAM sorted by coordinate. Mate pairs will not be merged.")
print("Sort by read name (samtools sort -n) if using paired-end reads.")

self.dataset = RNAseqDataset(
chrom_array=self.bam_in.header.references,
chrom_lengths=list(self.bam_in.header.lengths),
Expand Down
Loading

0 comments on commit ae15f57

Please sign in to comment.