# Class Genes

java.lang.Object
org.snpeff.interval.Genes

All Implemented Interfaces:
  `Serializable, Iterable<Gene>`

public class Genes extends Object implements Iterable<Gene>, Serializable
A collection of genes (marker intervals) Note: It is assumed that all genes belong to the same genome

Author:
  pcingola
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`boolean`
`debug`

## Constructor Summary

Constructors
Constructor
Description
`Genes(Genome genome)`

## Method Summary

Modifier and Type
Method
Description
`void`
`add(Gene gene)`
Add a gene interval to this collection
`void`
`createCircularGenes()`
In a circular genome, a gene can have negative coordinates or crosses over chromosome end.
`List<Intergenic>`
`createIntergenic()`
Creates a list of Intergenic regions
`void`
`createSpliceSites(int spliceSiteSize, int spliceRegionExonSize, int spliceRegionIntronMin, int spliceRegionIntronMax)`
Create splice sites.
`List<Marker>`
`createUpDownStream(int upDownLength)`
Creates a list of UP/DOWN stream regions (for each transcript) Upstream (downstream) stream is defined as upDownLength before (after) transcript Note: If upDownLength invalid input: '<'=0 no interval is created
`Transcript`
`findTranscript(String trId)`
Find a transcript by ID
`Gene`
`get(String geneId)`
Obtain a gene interval
`Gene`
`getGeneByName(String geneName)`
Obtain a gene by GeneName WARNING: The first match is returned.
`Iterator<Gene>`
`iterator()`
`int`
`size()`
`Collection<Gene>`
`sorted()`
`String`
`toString()`
`Collection<Gene>`
`values()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface Iterable

`forEach, spliterator`

## Field Details

### debug

public boolean debug

## Constructor Details

### Genes

public Genes(Genome genome)

## Method Details

### add

public void add(Gene gene)
Add a gene interval to this collection

### createCircularGenes

public void createCircularGenes()
In a circular genome, a gene can have negative coordinates or crosses over chromosome end. These genes are mirrored to the opposite end of the chromosome so that they can be referenced by both circular coordinates.

### createIntergenic

public List<Intergenic> createIntergenic()
Creates a list of Intergenic regions

### createSpliceSites

public void createSpliceSites(int spliceSiteSize, int spliceRegionExonSize, int spliceRegionIntronMin, int spliceRegionIntronMax)
Create splice sites.

Parameters:
  `createIfMissing` - : If true, create canonical splice sites if they are missing. For a definition of splice site, see comments at the beginning of SpliceSite.java

### createUpDownStream

public List<Marker> createUpDownStream(int upDownLength)
Creates a list of UP/DOWN stream regions (for each transcript) Upstream (downstream) stream is defined as upDownLength before (after) transcript Note: If upDownLength invalid input: '<'=0 no interval is created

### findTranscript

public Transcript findTranscript(String trId)
Find a transcript by ID

### get

public Gene get(String geneId)
Obtain a gene interval

### getGeneByName

public Gene getGeneByName(String geneName)
Obtain a gene by GeneName WARNING: The first match is returned. If multiple genes share the same gene name, no order can be expected for this method.

### iterator

public Iterator<Gene> iterator()

Specified by:
  `iterator` in interface `Iterable<Gene>`

### size

public int size()

### sorted

public Collection<Gene> sorted()

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### values

public Collection<Gene> values()