xyalign.assemble module

xyalign.assemble.bwa_mem_mapping_sambamba(bwa_path, samtools_path, sambamba_path, reference, output_prefix, fastqs, threads, read_group_line, bwa_params, cram=False)[source]

Maps reads to a reference genome using bwa mem. If output is in bam format, will sort using sambamba, else will sort with samtools

Parameters:

bwa_path : str

The path to bwa

samtools_path : str

The path to samtools

sambamba_path : str

The path to sambamba

reference : reftools.RefFasta() object

reftools.RefFasta() object of reference genome (in fasta format)

output_prefix : str

The prefix (including path) to the desired output files

fastqs : list

Fastqs, e.g. [‘sample_1.fastq’, ‘sample_2.fastq’]

threads : int

The number of threads/cpus to use

read_group_line : str

Read group info for bwa to add. If ‘None’, will not add read group.

bwa_params : list

Bwa parameters to be joined into a string and inserted into the command

cram : bool

If True, will output a sorted cram, else a sorted bam. Default is False.

Returns:

str

Path to output bam file (indexed)

Raises:

RuntimeError

If fastq or reference files cannot be found