Skip to content

Latest commit

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

GTF parser for Java Dataframes

A GTF Reader and Writer for Java DataFrames.

The GTF Format is implemented according to this documentation:

GFF/GTF File Format

traviscodecovCodacy Badge

Documentation

Javadocs

Install

Maven Central

Add this to you pom.xml

<dependencies>
...
<dependency>
<groupId>de.unknownreality</groupId>
<artifactId>dataframe-gtf</artifactId>
<version>0.2.4</version>
</dependency>
...
</dependencies>

Build

To build the library from sources:

  1. Clone github repository

    $ git clone https://github.com/nRo/DataFrame-GTF.git

  2. Change to the created folder and run mvn install

    $ cd DataFrame-GTF

    $ mvn install

  3. Include it by adding the following to your project's pom.xml:

<dependencies>
...
<dependency>
<groupId>de.unknownreality</groupId>
<artifactId>dataframe-gtf</artifactId>
<version>0.2.4-SNAPSHOT</version>
</dependency>
...
</dependencies>

Usage

Create a DataFrame from a GTF file

FilegtfFile = newFile("genome.gtf");
DataFramedf = DataFrame.load(gtfFile,GTFFormat.GTF)

Per default, all GTF fields are included in the resulting DataFrame. Attributes can be added by adding them to the GTF reader.

GTFReadergtfReader = GTFReaderBuilder.create()
.withAttribute("gene_id")
.build();
DataFramedf = DataFrame.load(gtfFile, gtfReader);

The column type of GTF fields is predefined:

GTF fieldtype
seqnameString
sourceString
featureString
startLong
endLong
scoreDouble
strandString
frameInteger

The type of attributes can be specified

GTFReadergtfReader = GTFReaderBuilder.create()
.withAttribute("gene_id")
.withAttribute("test_value", DoubleColumn.class)
.build();
DataFramedf = DataFrame.load(gtfFile, gtfReader);

DataFrames can be written according to the GTF format.

dataFrame.write(newFile("result.gtf"), GTFFormat.GTF);

About

GTF parser for Java Dataframes

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages