Skip to content

Commit

Permalink
Finish Release-1.0.1
Browse files Browse the repository at this point in the history
- Improved junctools to include a GTF comparison mode, including comparison of intron-chains.
- Improved handling of errors from portcullis
- Fixed a bug when trying to convert junction files in deduplicate mode.
  • Loading branch information
Daniel Mapleson committed May 24, 2017
2 parents 6c1ece0 + b05c5f9 commit 089c6b7
Show file tree
Hide file tree
Showing 10 changed files with 262 additions and 84 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Autoconf setup
AC_PREREQ([2.68])
AC_INIT([portcullis],[1.0.0],[daniel.mapleson@earlham.ac.uk],[portcullis],[http://www.earlham.ac.uk])
AC_INIT([portcullis],[1.0.1],[daniel.mapleson@earlham.ac.uk],[portcullis],[http://www.earlham.ac.uk])
AC_CONFIG_SRCDIR([src/portcullis.cc])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
# built documents.
#
# The short X.Y version.
version = '1.0.0'
version = '1.0.1'
# The full version, including alpha/beta/rc tags.
release = '1.0.0'
release = '1.0.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
48 changes: 47 additions & 1 deletion doc/source/junctools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ junctools can be displayed by typing ``junctools --help`` at the command line:
::

usage: This script contains a number of tools for manipulating junction files.
[-h] {compare,convert,markup,set,split} ...
[-h] {compare,convert,gtf,markup,set,split} ...

optional arguments:
-h, --help show this help message and exit
Expand All @@ -19,6 +19,7 @@ junctools can be displayed by typing ``junctools --help`` at the command line:
{compare,convert,markup,set,split}
compare Compares junction files.
convert Converts junction files between various formats.
gtf Filter or markup GTF files based on provided junctions
markup Marks whether each junction in the input can be found in the reference or not.
set Apply set operations to two or more junction files.
split Splits portcullis pass and fail juncs into 4 sets (TP, TN, FP, FN) based on whether or not the junctions are found in the reference or not.
Expand Down Expand Up @@ -208,6 +209,51 @@ The usage information for the conversion tool looks like this::

.. note:: The user can also use the conversion tool to deduplicate, sort and reindex junction files.


.. _gtf:

GTF
---

Provides a means of manipulating or analysing GTF files using a junctions file.
Three modes are currently supported, the first two filter and markup, will process
a GTF file and either remove, or mark, transcripts and their associated exons, if
junctions within that transcript are not supported by the provided junction file.
In compare mode, we benchmark GTF files based on whether junctions present are
found in a reference junction file. This gives junction-level accuracy statistics
as well as transcript-level stats.

Usage information follows::

usage: This script contains a number of tools for manipulating junction files. gtf
[-h] [-is] -j JUNCTIONS [-o OUTPUT] mode input [input ...]

GTF modes:
filter = Filters out transcripts from GTF file that are not supported by the provided
junction file.
markup = Marks transcripts from GTF file with 'portcullis' attribute, which indicates
if transcript has a fully supported set of junctions, or if not, which ones are
not supported.
compare = For each GTF provided in the input. compare mode creates statistics describing
how many transcripts contain introns that are supported by a junction file.

positional arguments:
mode GTF operation to apply. See above for details. Available options:
- filter
- markup
- compare
input The input GTF file to convert

optional arguments:
-h, --help show this help message and exit
-is, --ignore_strand Whether or not to ignore strand when looking for junctions
-j JUNCTIONS, --junctions JUNCTIONS
The file containing junctions that should be found in the GTF.
-o OUTPUT, --output OUTPUT
The filtered or markedup GTF output. By default we print to stdout.



.. _markup:

Markup
Expand Down
8 changes: 5 additions & 3 deletions scripts/junctools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__author__ = 'Daniel Mapleson'
__license__ = 'GPLV3'
__copyright__ = 'Copyright 2016 Daniel Mapleson'
__version__ = '1.0.0'
__version__ = '1.0.1'

import argparse
import sys
Expand Down Expand Up @@ -78,10 +78,12 @@ def main():
help="Filter or markup GTF files based on provided junctions",
description='''GTF modes:
filter = Filters out transcripts from GTF file that are not supported by the provided
junction file
junction file.
markup = Marks transcripts from GTF file with \'portcullis\' attribute, which indicates
if transcript has a fully supported set of junctions, or if not, which ones are
not supported.''')
not supported.
compare = For each GTF provided in the input. compare mode creates statistics describing
how many transcripts contain introns that are supported by a junction file.''')
gtf.add_options(gtf_parser)
gtf_parser.set_defaults(func=gtf.gtf)

Expand Down
6 changes: 4 additions & 2 deletions scripts/junctools/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ truesight = Truesight style tab delimited format.''')
help="Filter or markup GTF files based on provided junctions",
description='''GTF modes:
filter = Filters out transcripts from GTF file that are not supported by the provided
junction file
junction file.
markup = Marks transcripts from GTF file with \'portcullis\' attribute, which indicates
if transcript has a fully supported set of junctions, or if not, which ones are
not supported.''')
not supported.
compare = For each GTF provided in the input. compare mode creates statistics describing
how many transcripts contain introns that are supported by a junction file.''')
gtf.add_options(gtf_parser)
gtf_parser.set_defaults(func=gtf.gtf)

Expand Down
4 changes: 2 additions & 2 deletions scripts/junctools/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ def convert(args):
else:
with open(args.input) as f:
for line in f:
j = JuncFactory.create_from_enum(in_type, use_strand=not args.ignore_strand).parse_line(line)
j = JuncFactory.create_from_enum(in_type, use_strand=not args.ignore_strand).parse_line(line.strip())

if j:

if args.dedup:
if j.key not in junction_set:
junction_set.add(j.key())
junction_set.add(j.key)
if loadall:
junctions.append(j)
else:
Expand Down

0 comments on commit 089c6b7

Please sign in to comment.