'\" t .\" Title: filterbam .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.17 .\" Date: .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" .TH "FILTERBAM" "1" "" "\ \&" "\ \&" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" filterBam \- filter BAM file for use with AUGUSTUS tools .SH "SYNOPSIS" .sp \fBfilterBam\fP \-\-in in.bam \-\-out out.bam [options] .SH "DESCRIPTION" .sp The input file must be sorted lexicographically by \*(Aqqueryname\*(Aq, with e.g. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} Convert the file into SAM format, sort lexicographically by queryname and convert back again into BAM format. .br E.g. .br \fBexport LC_ALL=C\fP .br \fBsamtools view \-H file.bam > file_sorted.sam\fP .br \fBsamtools view file.bam | sort \-k 1 >> file_sorted.sam\fP .br \fBsamtools view \-bS file_sorted.sam > file_sorted.bam\fP .br [be aware: \*(Aqexport LC_ALL=C\*(Aq might be used because sort ignores characters like \*(Aq:\*(Aq] .br Also, please bear in mind that this will require converting your BAM file into SAM. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} \fBsamtools\fP and \fBbamtools\fP provide facilities to do the sorting, but they are not guaranteed to work because of the problem mentioned above. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} In the case of \fBsamtools\fP, the command to sort by \*(Aqqueryname\*(Aq is: .br \fBsamtools sort \-n \-o file_sorted.bam file.bam\fP .br For more information check the man page included in samtools distribution. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} bamtools can also sort bam files: .br \fBbamtools sort \-byname \-in file.bam \-out file_sorted.bam\fP .br but only provides the option to do it by queryname. .RE .SH "OPTIONS" .SS "Mandatory options" .sp \fB\-i\fP, \fB\-\-in=in.bam\fP .RS 4 input file in BAM format .RE .sp \fB\-o\fP, \fB\-\-out=out.bam\fP .RS 4 output file in BAM format .RE .SS "Optional options" .sp \fB\-u\fP, \fB\-\-uniq\fP .RS 4 keep only the best match, remove all matches, if the second best is not much worse .RE .sp \fB\-q f\fP, \fB\-\-uniqThresh=f\fP .RS 4 threshold % for uniq, second best must be lower than this fraction of best to keep the best match (default 0.96) .RE .sp \fB\-b\fP, \fB\-\-best\fP .RS 4 output all best matches that satisfy minId and minCover .RE .sp \fB\-e n\fP, \fB\-\-minId=n\fP .RS 4 minimal percentage of identity (default 92) .RE .sp \fB\-c n\fP, \fB\-\-minCover=n\fP .RS 4 minimal percentage of coverage of the query read (default 80) .RE .sp \fB\-n\fP, \fB\-\-noIntrons\fP .RS 4 do not allow longer gaps \-for RNA\-RNA alignments\- .RE .sp \fB\-l n\fP, \fB\-\-insertLimit=n\fP .RS 4 maximum assumed size of inserts (default 10) .RE .sp \fB\-s n\fP, \fB\-\-maxSortesTest=n\fP .RS 4 test if input file is sorted by query name for this number of alignments (default 100000) .RE .sp \fB\-p\fP, \fB\-\-paired\fP .RS 4 require that paired reads are on opposite strands of same target. Requires alignment names to contain the suffixes /1,/2 or /f,/r. .RE .sp \fB\-w\fP, \fB\-\-pairwiseAlignments\fP .RS 4 use in case alignments were done in pairwise fashion .RE .sp \fB\-x n\fP, \fB\-\-maxIntronLen=n\fP .RS 4 maximal separation of paired reads (default 500000) .RE .sp \fB\-d file\fP, \fB\-\-pairBedFile=file\fP .RS 4 file name of pairedness coverage: a BED format file in which for each position the number of filtered read pairs is reported that contain the position in or between the reads .RE .sp \fB\-g file\fP, \fB\-\-commonGeneFile=file\fP .RS 4 file name in which to write cases where one read maps several different genes .RE .sp \fB\-t n\fP, \fB\-\-threads=n\fP .RS 4 use n threads for compression/decompression (default 1); available only if library SeqLib >= 1.2 is used .RE .sp \fB\-v\fP, \fB\-\-verbose\fP .RS 4 output debugging info .RE .sp \fB\-h\fP, \fB\-\-help\fP .RS 4 produce help message. .RE .SH "AUTHORS" .sp AUGUSTUS was written by M. Stanke, O. Keller, S. König, L. Gerischer and L. Romoth. .SH "ADDITIONAL DOCUMENTATION" .sp An exhaustive documentation can be found in the file /usr/share/doc/augustus/README.md.gz.