.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "FILTER 1"
.TH FILTER 1 "2021-08-15" "perl v5.32.1" "User Contributed Perl Documentation"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
filter.pl \- filters output from murasaki based on various filters
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
filter.pl [options] <detailed murasaki ailgnment file> [output file]
.SH "OPTIONS"
.IX Header "OPTIONS"
.Vb 11
\& Filtering options:
\&Filtering can be performed on "length", "hits", "tfidf", or "score".
\&You can filter by either setting either a "min" or "max".
\&For example: "\-\-minlength 50" filters out any anchors with an average
\&length shorter than 50. (average length is used because an anchor
\&may be different sizes on different sequences).
\&Filters can also use the average(x), standard deviation(s),
\&variance(v), or anchor count(a) in an expression to set a filter.
\&For example: "\-\-minscore=2x" sets the minimum score threshold to
\&twice the average score. "\-\-minlength=x+s/2" sets the minimum length
\&threshold to the average length plus half a standard deviation.
\&
\& Input modification:
\& "\-\-widen=500" => extends each anchor 500 bases in both directions
\& "\-\-randomwiden=500" => extends each anchor 500 bases _at random_
\&   (ie: to compare to \-\-widen)
\&
\& Output options:
\& "\-\-statdump" => dump all available stats into 1 file with a header row
\& "\-\-dumpstats tfidf,length" => dumps stats tfidf and length to separate files
\&                               one line per anchor
\& "\-\-dumpstats" => assumes "\-\-dumpstats all"
\&
\& Plot options:
\&filter.pl can plot any or all of the statistics gathered by using
\&the "\-\-plot" option.
\& Examples:
\& "\-\-plot hits,length" => plots both hits and length
\& "\-\-plot" => assumes "\-\-plot all"
\&
\& "\-\-plotopts" allows setting of various gnuplot and special plot options.
\&Different statistics can be targeted separately by prefixing the setting
\&name with the statistic(s) of your choice followed by a "."
\&For example:
\&  "\-\-plotopts hits,length.flatx" => disables the log scale on the x axis
\&                                    of the hits and length plots only
\&  "\-\-plotopts with=points" => uses points instead of bars on all plots
\&  "\-\-plotopts <gnuplot option>=<value>" => can be used to set arbitrary
\&       gnuplot options of the form "set <gnuplot option> <value>"
\&
\& "\-\-bins" can be used to specify the number of bins.
\& "\-\-nobins" turns off binning and plots a raw (likely bumpy) histogram
\& "\-\-showall=crop" sends all data to gnuplot even on logscale plots (by
\&    default for logscale plots values <=1 at the extreme right end are
\&    chopped off because they don\*(Aqt show up in gnuplot (1 is the baseline)
\&    but they  do affect the visible range, and thus causes some scrunching.
\& "\-\-showall=scale" manually sets to the X and Y ranges to the range of the
\&    data (so 1\*(Aqs are visibly different from 0\*(Aqs).
\& "\-\-showall=<anything else>" disables scaling/cropping
.Ve
.PP
The Gnuplot commands for generating the plots are also dumped to
<something>.<stat\-type>.plot and can be run interactively in gnuplot
by typing: load \*(L"<something>.<stat\-type>.plot\*(R"
.PP
.Vb 10
\& Statistical Options:
\& "\-\-all/\-\-quick" => standard deviation calculations require a second
\&    pass through the data, and as histogram plots are generally much
\&    more useful than a standard deviation statistic (especially considering
\&    not all of these statistics may be gaussian), so unless one of your
\&    constraints calls for standard deviation, this calculation is skipped.
\&    It can be forced by applying \-\-all. (\-\-quick is the default)
\& "\-\-nodetails" => disables reconstruction of term indicies (this will
\&    disable tfidf stats).
\& "\-\-tags" => enables reading of annotation.
\&    This produces "good, miss, shuffle" stats (which can also be plotted)
\&    and specificity/sensitivity information
\& "\-\-notags" => disables reading of annotation (by default)
\&
\& COG/KOG Statistics:
\& At any rate:
\& "\-\-kogfile=path/to/kog" => enables kog\-based alignment
\& "\-\-kogmap 3=hsa" => forces sequence 3 (note: sequences are 0 indexed) to
\&    be assigned to the "hsa" kog. If the file name includes one of the
\&    kog species abbreviations, it is assumed to belong to that kog.
\&
\& Debugging:
\& "\-\-linear" => forces linear scans for CDS\*(Aqs instead of binary searches
\&    (if this returns different results, it means something is very wrong)
\&
\& [output file]:
\&If the input filename is of the form <something>.anchors.details, then the
\&[output file] defaults to <something>.filtered.
.Ve
.PP
Incidentally, if you don't provide a <something>.anchors.details file,
it probably won't work anyway...
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Filters murasaki alignments based on various statistics. Various statistics can be plotted using \-\-plot. Annotation data is processed from input files
using BioPerl.
.PP
\&\s-1ROC\s0 data can be calculated using \s-1KOG\s0 data (which is much more reliable
than just gene names). To do so you need to specify a \s-1KOG\s0 data file
which can be downloaded from the \s-1COG\s0 database at:
http://www.ncbi.nlm.nih.gov/COG/
You'll be looking for either the \*(L"whog\*(R" file for COGs or the \*(L"kog\*(R" file
on the \s-1KOG\s0 side. \s-1KOG\s0 locus naming sometimes differs from \s-1GBK\s0 file to
file, and locus names are sometimes missing, so \s-1KOG\s0 based assessment
is currently best effort (capitalization is ignored, locii which don't
appear in the annotation are ignored, and domain-specific _x endings
are ignored).
