Skip to content

mitopiper 2.0.2

Choose a tag to compare

@github-actions github-actions released this 26 Nov 13:01
· 4 commits to master since this release
4c075c5

Fixes of a full audit on an HPC cluster (9 high and 19 medium findings). Upgrading: run
mitopiper presets reset in every workspace (the mt presets now count deletions on both strands, mpileup -d 0,
pair the rotated realignment, and count exon,CDS for NCBI GFF3). Derived references are named anew, so the
next reference job builds them once more (about an hour for the human nuclear + mtDNA index).
heteroplasmy_matrix.tsv has a new alt column.

Added

  • One-line summaries of the presets, shown where a workflow is chosen (interactive menu) and by presets list; the two NUMT-aware presets now say how they remove NUMT reads (mapping quality vs Numt Parser). Your own presets take one with presets save NAME --description "..." or at the interactive save prompt (general setting preset_summary).

Fixed

  • Deletions on the reverse strand were counted as forward (audit H3): the pileups were made without samtools mpileup --reverse-del, so samtools wrote * for every deletion and no deletion heteroplasmy could have support on both strands. Every pileup of the presets now uses it, and mt annotate warns about a pileup made without it. Workspaces made before: presets reset.
  • Diagnosis: featureCounts' "failed to find the gene identifier attribute" gets its own cause and fix; the htseq-count advice no longer suggests -t gene (which counts reads in introns) (audit H9).
  • STAR's --genomeSAindexNbases is rounded down, as STAR's formula says (audit M7).
  • NUMT-aware presets: the rotated alignment treated paired-end reads as single-end (samtools fastq of the position-sorted .mt.bam into bwa mem without -p): where two mates overlap, mpileup counted the overlap twice in the 400 positions on each side of the origin (the D-loop), raising depth and per-strand support there. The reads are now grouped by pair (samtools collate) and aligned as pairs (bwa mem -p). Paired-end samples of mt-variants-numt and mt-variants-numtparser get different depths and allele counts near the origin; workspaces made before need mitopiper presets reset mt-variants-numt mt-variants-numtparser.
  • A gzipped annotation (Ensembl ships .gtf.gz) crashed mitopiper mt annotate near the end of every mt sample job ('utf-8' codec can't decode byte 0x8b); annotations are now read gzipped or not.
  • refs add refuses a gzipped --fasta, --nuc-fasta or --numt-fasta (e.g. Ensembl's *.dna.primary_assembly.fa.gz): samtools faidx, STAR and the mtDNA tools need a plain FASTA, and the reference job failed.
  • rnaseq-expression counts exon,CDS features for a GFF3 annotation (placeholder _count_features): NCBI's annotation gives the 13 mtDNA protein-coding genes only gene and CDS lines, so -t exon left ND1 ... CYB out of the counts. A GTF is still counted by exon.
  • build stops when an annotation names no gene on the counted lines at all (Ensembl GFF3, whose exons carry only Parent=transcript:...), and says to register the GTF version.
  • STAR's index for a genome that refs fetch-genome downloads is sized from the genome's length at NCBI (--genomeSAindexNbases, e.g. 11 for yeast): it got STAR's default 14, which STAR warns may crash the mapping of small genomes.
  • STAR: --limitBAMsortRAM 8 GB (was 1.2 GB, which fails on deep samples after the whole mapping) and the STAR step asks for 40G (was 32G), which also covers a human index in the reference job.
  • Default preset: samtools mpileup -d 0 (samtools caps the depth at 8000 otherwise; the mt presets already had it); htseq-count reads the sorted BAM with -r pos; the index step declares its real output (.sorted.bam.bai).
  • rnaseq-expression counted with featureCounts -g gene_id, an attribute NCBI's GFF3 does not have (it names genes with gene= on exon lines). With the human annotation mitopiper itself downloads (refs fetch-genome), every sample failed at the last step, after hours. The attribute is now the placeholder _exon_gene_attr, read from each reference's annotation (Ensembl/GENCODE GTF: gene_id; NCBI GFF3: gene), or guessed from its name when the reference job has not downloaded it yet. The default preset's htseq-count -i likewise uses _gene_attr (gene_id / ID). Workspaces made before keep their literal value: build now stops with an error when a counting step's attribute is not on the annotation's lines, with the fix. Found in an LSF test.
  • The download diagnoses (HTTP 403 and 404, no network) apply only when the job failed while downloading: a download that hit a 403 and then succeeded over another protocol made a job that failed hours later at featureCounts read "The archive refused the download".
  • README: a sample job reserves its largest step's resources for its whole run, downloads included; download_mode queue for large public data.
  • The reference job built a STAR index with 4 threads in a 1-slot job (rnaseq-expression, GRCh38 on an LSF cluster that enforces CPU: one core for 4 threads, still sorting after 77 minutes; 26 of 30 GB used). STAR now indexes with the threads of the STAR step (8), and the reference job asks for those slots and at least the STAR step's memory plus 8 GB (40 GB by default; reruns too). STAR's temporary folder is next to the index instead of the folder master.sh was run from, where reference jobs of two organisms would have shared it.
  • --auto-fix after an out-of-memory kill asks for at least 1 GB: a job killed at 100 MB that needed 600 MB got 200 MB and failed again.
  • refs add stores absolute paths: a relative --fasta/--gtf only worked when master.sh was run from the same folder.
  • A FASTQ folder pooled numbered samples: x_101_R1/_R2, x_102_R1/_R2 and so on lost their _101, _102 and became one sample x. Only a lane (_L001) is now taken off a name; S1_L001_R1_001 and S1_L002_R1_001 stay one sample S1. A sample of several runs is logged.
  • Runs of different assays of one BioSample were pooled (WGS and RNA-seq of the same donor, in one pileup under one strategy). Each assay is now a sample of its own, with a warning.
  • The table of an imported FASTQ folder is written from the runs found in the folder, not from a re-scan of the placed copies.
  • Downloads go to <file>.part and are renamed when complete and checked, so a job killed mid-download leaves nothing at the path the next steps read; a multi-run sample is concatenated the same way. A file already complete with the right checksum is not downloaded again.
  • A single-end request of a paired SRA run (the SRA fallback) takes mate 1: it took <run>.fastq, the few reads fasterq-dump --split-3 leaves without a mate.
  • presets set <preset> ignore_paired_end=no (also yes, on, off) stores a boolean: no was stored as text, which counted as true.
  • A rerun's experiment job did not wait for the samples still queued or running: it waited only for the rerun samples, while the experiment job it replaced (cancelled) waited for all, so the cohort tables missed samples or read half-written ones and the job ended DONE. It now also waits for them (array tasks included, in each scheduler's syntax) and checks that all of them finished. rerun says which, and warns when failed samples it does not run will make the experiment job fail.
  • mt heteroplasmy fails when a sample's table is missing (listed in heteroplasmy/left_out.txt; the others are still collected): it only warned, and the cohort matrix silently lacked the sample.
  • An array rerun rewrote the task list (a_<exp>.list) that queued tasks of the original array still read: they ran another sample's script, or nothing. Each rerun now has its own list and wrapper (a_<exp>.rerun_<time>.list/.array). Queued array tasks are cancelled too (scancel 20_3, bkill '20[3]', qdel -t 3 20): with --include-pending a sample ran twice at once. The wrapper fails loudly when its task has no line in the list.
  • The wrapper of an array rerun asks for the rerun's resources (--memory, --walltime, automatic fixes, the largest of its samples'): it asked for the build's, while the sample scripts it runs asked for more.
  • References fetched again, or switched, reused files made from the old ones. refs fetch-mt wrote every accession to one <organism>.fasta, and the reference job kept any index that was there, so after fetching another accession its old .fai, bwa index and rotated copy were used with the new sequence (htslib reads the new bytes at the old offsets, without a warning). Each accession now has its own folder (references/mtDNA/<organism>/<accession>/), and every index and derived reference is built again when the file it is made from is newer.
  • Derived references were named after the mtDNA FASTA's file name only: another chrM.fa, a switched nuclear genome or another --numt-fasta reused the rotated, nuclear + mtDNA and NUMT files of the first (a rotated hg19 chrM used with hg38 shifts every position of the control region). The names now carry a key of the files each is made from. Existing workspaces build their derived references once more (for human, the nuclear + mtDNA bwa index of the NUMT presets takes about an hour). Downloaded genomes go to a folder per assembly (references/genome/<organism>/<accession>/), so two assemblies no longer share one STAR index.
  • A genome set could become the mtDNA of the mt presets: refs fetch-genome made it the active set, and the size check passed while its FASTA was not downloaded yet (the reference job then rotated chr1). build now refuses a genome set as the mtDNA from the start; fetch-genome (and the interactive download) makes the new set active only when the organism has none, or with --activate; refs remove of the active set no longer silently activates the first other set by name (one remaining set takes over, with a message; with several, you choose).
  • Genomes downloaded by refs fetch-genome keep only the primary assembly (mitopiper mt primary-assembly, from NCBI's assembly report): the alt loci and patches (GRCh38.p14: 514 scaffolds) made reads of the HLA and similar regions multi-mapped, lost to the gene counts and the NUMT search. Sets fetched before keep their FASTA. Downloaded files are unpacked next to the final file, which appears only when complete.
  • A staged build (--steps, --skip) deleted files that its later stages needed: with the CLI's own example --steps wget,trim,fastqc and keep_reads false, the reads were gone before the alignment. A file is deleted only when no step left out of the build reads it.
  • Steps in a container or conda environment lost pipefail: their commands ran in sh -c, so a failed bwa in bwa mem | samtools sort gave a valid, partial BAM, the job went on and deleted the reads. They now run in bash -o pipefail when the environment has bash (else sh with pipefail where it knows it); where neither can, the job keeps its temporary files and reads. The tool check no longer reads the tools of a container's pipeline as tools needed outside it.
  • LSF: the monitor lost every state of an experiment when one of its jobs was past LSF's CLEAN_PERIOD (bjobs exits 255 then, printing the others): killed jobs showed RUNNING for ever. The jobs LSF still knows are now read from its answer.
  • LSF array tasks: the monitor and the diagnosis read the empty LSF task file (<id>_<task>.err) instead of the sample's own stderr, so array jobs got no error lines and no diagnosis. An empty log is now used only when there is no other.
  • Status files written before a job was submitted (an earlier run of a rebuilt experiment) are ignored: queued jobs showed the DONE or FAILED of the earlier run, and a rerun resubmitted a "FAILED" job still in the queue.
  • download_mode login skipped every download on a cluster: the login-node download checked that the tool check and reference jobs, just submitted, had finished. It now waits for nothing; the sample jobs check all three.
  • The interactive monitor (monitor -i) said "All jobs finished successfully." when jobs had never been submitted (master.sh not run, or stopped before them) or when the experiment name was mistyped. It now says which jobs were never submitted, or that the experiment is unknown, and exits 1.
  • Validation harness (benchmark/compare.py, tutorial/check_results.py): calls are checked for the planted allele, in the annotated table and in the VCF's REF, ALT and GT (new accuracy.tsv columns allele_errors, vcf_errors, false_positives_outside_numt): a wrong base or a strand mix-up at the right position passed before. The default preset (plain) now has accuracy checks (all 4 heteroplasmies, frequency error, no false call outside the NUMT differences). A third simulated sample, edge, has a heteroplasmy and a one-base deletion next to the end of the mtDNA, where the circular pileup takes the rotated alignment; all three presets must find both with the right allele (this guards the deletion counting on both strands and the junction merge). It is made with its own random generator, so the reads and numbers of patient and control are unchanged; the sample jobs are now s_control_0, s_edge_1, s_patient_2.
  • heteroplasmy_matrix.tsv gave each sample's own minor allele frequency, folded and with no allele: 100% reference and 100% alternative both read 0 (the tutorial's homoplasmic G>A at 7000 read 0, 0), and 30% and 70% of one allele both read 0.3, so the samples could not be compared. It now has an alt column (one row per position and called non-reference allele, the most often called first) and each cell is that allele's count over the sample's allele depth. heteroplasmy_sites.tsv is unchanged. Scripts reading the matrix need the new column.

md5sum mitopiper-2.0.2.tar.gz must print eeb5da3559eb9642c1930940e6191d17. Once installed, mitopiper --version must name commit 4c075c5.