PERM(1)
π¦ PERM(1) Β· PerM π¦
β¨ NAME β¨
okay bestie, perm is the tool, and its whole thing is efficient mapping of short reads with periodic spaced seeds π§
If you have any usage questions, please email "yanghoch at usc dot edu". π
π SYNOPSIS π
To use the command line, type perm with the args in the order. π
π EXAMPLES π
For single-end reads:
perm Ref Reads [options]
Examples:
perm Ref.fasta Reads.fasta -v 5 -o out.mapping -u ummappedReads.fa
perm RefFilesList.txt ReadsSetFilesList.txt -v 5 -u unmappedReads.fa -E
perm Ref.fasta Reads.csfasta -v 5 -m -s my.index --delimiter Β΄,Β΄ --seed F3
perm my.index SingleEndReads.csfasta -v 5 -o out.sam -k 10 -a ambiguous10.csfasta
For paired-end reads:
perm Ref -1 F3_Reads -2 R3_Reads [options]
Examples:
perm ref.fa -1 F3.fa -2 R3.fa -U 3000 -L 100 -v 5 -A -m -s -o out.sam
perm ref.txt -1 F3.fq -2 R3.fq -v 5 -m -s my.index -o out.mapping --seed F3
perm my.index -1 F3.fq -2 R3.fq -U 3000 -L 100 -v 5 -A -o out.sam
To build an index only:
perm Ref Read_Length --readFormat <.csfasta|.fasta> -m -s index path --seed F3
Example:
perm hg18.txt 50 --readFormat .csfasta -m -s hg18_50_SOLiD.index
πΈ OPTIONS πΈ
π Required Arguments
- Reference file: this should be FASTA with the
.fasta,.fna, or.faextension. For a transcriptome with multiple genes or isoforms as the reference, concatenate all the FASTA sequences into one single FASTA file. If you've got lots of files (like one per chromosome, ex: chr1.fa to chrY.fa), list the FASTA filenames one per line in a file with the.txtextension. The.txtpart is super important because PerM checks the file extension to figure out whether the input is a list of filenames. Filenames need to include the file path (relative or absolute) unless all the FASTA files live in the same directory PerM is run from. - Read files: these should be
.fasta,.fastq,.csfastaor.csfastq. PerM parses a file based on its extension, or on the format you explicitly set with--readFormat <format>. If you've got multiple read files, list each filename one per line in a.txtfile. PerM takes that list as the input and can map multiple read sets in parallel using OpenMP (http://en.wikipedia.org/wiki/OpenMP).
π§ Short Options (grouped by related functionality)
-Aβ output all alignments within the mismatch threshold (see-voption), end-to-end. β¨-Bβ output the best alignments in terms of mismatches within the threshold (see-voption). For example, if a read has no perfect match alignments, two single base mismatch alignments, and additional alignments with more mismatches, only the two single base mismatch alignments get output.-Bis the default mode if you don't specify-Aor-B. π-Eβ output only the uniquely mapped reads left over after the best down selection has been applied (if applicable). When you combine it with-A, only reads with a single alignment within the mismatch threshold (see-voption) get output. π¦-vβ the maximum number of mismatches allowed (or allowed in each end for paired-end reads). The default is the number of mismatches that the seed you're using is fully sensitive to. π-kβ the max number of alignments to output. If you don't give-k, the default is 200. Alignments for reads mapping to more than that max number of positions won't be output. Use the-aoption to collect the reads that went over the max. π-tβ the number of bases at the 5Β΄ end of each read to ignore. For example, if the first 5 bases are a barcode or you're using them to index multiple samples together, use-t 5. If you don't specify it, no initial bases get ignored. π-Tβ the number of bases in each read to use, starting after any bases ignored by the-toption. Later bases at the 3Β΄ end of the read get ignored. For example,-T 30means use only the first 30 bases (signals) after any bases ignored due to the-toption. π-mβ create the reference index without reusing a saved index, even if one is available. π₯-s pathβ save the reference index so mapping is faster next time. If you don't specify a path, the index gets created in your current working directory (aka wherever you ran PerM from) using the default index name. If the path is a directory, the index gets created in that directory with the default index name (the directory has to already exist, it won't be made for you). If the path is a file path, the index gets created with that exact name. π-o filepathβ the name of the mapping output file when you're mapping a single read set. The format is either the.mappingtab-delimited text format or SAM, depending on the extension of the output filename. For example,-o out.samoutputs SAM, and-o /path/to/out.mappingoutputs.mappingformat. Use--outputFormatto override this behavior. The-ooption doesn't apply when you map multiple read sets at once to take advantage of multiple CPUs (cores), so check the-doption for that case. π-d dirpathβ the output directory for mapping output files when you're mapping multiple read sets (the output files get named automatically). If the directory doesn't exist, it'll be created as long as the parent directory exists. If you don't specify-d, files get written to the directory PerM is run from. Heads up: if you use-d filepathwhile mapping a single read set, dirpath gets prepended to filepath.
β οΈ That -d usage is not recommended, so maybe just avoid it. π
-a filepathβ create a FASTA (FASTQ) file for reads mapped to more positions than the threshold set by-k(or the default of 200). π§-b filepathβ create a FASTA (FASTQ) file for reads that are shorter than the expected length or have strange characters. π«Ά-u filepathβ create a FASTA/FASTQ file of unmapped reads. When you map a single read set, the filename you give is the name of the output file. When you map multiple read sets, the filename is irrelevant and should be left off. The unmapped sequence files get named and created automatically in the directory PerM is run from. πΈ
βοΈ part 2 picks up with the long options, so stay tuned π«Ά
β¨ DEFAULT SETTINGS β¨
okay so these are the defaults PerM uses when you don't pass the matching command line option π if you want something different, you gotta specify the option yourself bestie π«Ά
- Mismatch rules π β PerM allows only two mismatches, and only in each end, using seed
F,,2,,,S,,11,,, orF,,3,,. Which one it picks depends on your read lengths and types. - Output ranking π¦ β it prints the best alignments for each read, ranked by the number of mismatches.
- File format π β output files come out in
*.mappingformat. - Saved index check π β it looks for a saved index under the default file name before it builds a new one.
- Index saving π
ββοΈ β it won't save the index to a file unless you specify
-s. - Paired end distance π β for paired end reads, the default allowed separation distance is 0-3000 bp. Change it with the
-Land-Uoptions β¨
π Parallel Mapping
this one is lowkey iconic π PerM can map multiple read sets from a list at the same time by querying the same index. It detects how many CPUs (cores) are available and gives each one a read set. When a read set finishes, the next one in the list gets processed automatically π₯ each read set gets its own mapping output file.
To make the most of all your CPUs on a node, split large read sets into lots of small ones and put those in a list π§ if you're using multiple nodes on the same file system, have one node pre-build the index first. The other nodes will read that pre-built index instead of building their own. Without a pre-built index, every machine tries to build its own, which wastes CPU time and storage space π
πΈ Exit codes
PerM exits with 0 on successful completion, which is the normal Unix behavior β
if you terminate it with Ctrl-C (SIGINT), the exit code is 2, the number for SIGINT (see man kill) π if you call PerM from another language, you can check the return code and do something smart with it. Here's a Perl pseudo-code example, bestie π
while (... some sort of loop ...) {
my $cmd = "PerM ... arguments and switches";
my $ec = system($cmd);
if ($ec == 2) {
print STDERR "PerM terminated via Ctrl-C. Stopping run.\n\n";
# Maybe do some cleanup such as deleting the small files the read file was
# split into for parallel processing.
exit($ec);
}
}
π§ Use PerM on Galaxy
huge shoutout to Prof Anton Nekrutenko and Kelly Vincent at PSU π«Ά you can now use PerM on Galaxy's test server at http://test.g2.bx.psu.edu/. Follow the link to Galaxy's page and click NGS:Mapping in the tool menu. Choose Map with PerM for SOLiD and Illumina. You can upload your own reference or use the pre-built hg19 index already in the system π if you run into any difficulties, email me. Once the system proves it's stable, it'll move to Galaxy's main server with more pre-built reference indexes β
π Unit Test
when PerM was being developed, a unit cppUnit test module was prepared too π if you're curious about the test code for PerM, email me and I'll share it π¦
and that's a wrap on PerM(1)! πΈ written by Yangho Chen back in April 2014, so the whole vibe is a little vintage but the info is still chef's kiss π β¨
π¦ where this page comes from
- debian bookworm: perm 0.4.0-8+b1 Β· Apache-2.0
- debian trixie: perm 0.4.0-8+b1 Β· Apache-2.0
- ubuntu jammy: perm 0.4.0-8 Β· Apache-2.0
- ubuntu noble: perm 0.4.0-8 Β· Apache-2.0
- ubuntu resolute: perm 0.4.0-8 Β· Apache-2.0
- ubuntu stonking: perm 0.4.0-8build1 Β· Apache-2.0
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms