Package vcf
Class RefIt
- java.lang.Object
-
- vcf.RefIt
-
- All Implemented Interfaces:
FileIt<RefGTRec>,SampleFileIt<RefGTRec>,java.io.Closeable,java.lang.AutoCloseable,java.util.Iterator<RefGTRec>
public class RefIt extends java.lang.Object implements SampleFileIt<RefGTRec>
Class
RefItrepresents an iterator whosenext()method returns an object storing data from a VCF record with phased, non-missing genotypes.Instances of class
RefItare not thread-safe.Methods of this class will terminate the Java Virtual Machine with an error message if an I/O error or file format error is detected.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Terminates the iteration and releases any system resources that are held by this object.static RefItcreate(FileIt<java.lang.String> strIt)Create and returns a newRefItinstance from the specified iterator.static RefItcreate(FileIt<java.lang.String> it, Filter<java.lang.String> sampleFilter, Filter<Marker> markerFilter)Create and returns a newRefItinstance from the specified objects.static RefItcreate(FileIt<java.lang.String> it, Filter<java.lang.String> sampleFilter, Filter<Marker> markerFilter, int bufferSize)Create and returns a newRefItinstance from the specified objects.java.io.Filefile()Returns the file from which the data are read, ornullif the data are read from standard input or are computed data.booleanhasNext()Returnstrueif the iteration has more elements, and returnsfalseotherwise.RefGTRecnext()Returns the next element in the iteration.voidremove()Theremovemethod is not supported by this iterator.Samplessamples()Returns the list of samples.java.lang.StringtoString()Returns a string representation ofthis.
-
-
-
Method Detail
-
create
public static RefIt create(FileIt<java.lang.String> strIt)
Create and returns a newRefItinstance from the specified iterator.- Parameters:
strIt- an iterator that returns lines of a VCF file- Returns:
- a new
RefItinstance - Throws:
java.lang.IllegalArgumentException- if a format error is detected in a line of a VCF file returned bystrItjava.lang.NullPointerException- ifstrIt == null
-
create
public static RefIt create(FileIt<java.lang.String> it, Filter<java.lang.String> sampleFilter, Filter<Marker> markerFilter)
Create and returns a newRefItinstance from the specified objects.- Parameters:
it- an iterator that returns lines of a VCF filesampleFilter- a sample filter ornullmarkerFilter- a marker filter ornull- Returns:
- a new
RefItinstance - Throws:
java.lang.IllegalArgumentException- if a format error is detected in a line of a VCF file returned bystrIttjava.lang.IllegalArgumentException- ifbufferSize < 1java.lang.NullPointerException- ifstrIt == null
-
create
public static RefIt create(FileIt<java.lang.String> it, Filter<java.lang.String> sampleFilter, Filter<Marker> markerFilter, int bufferSize)
Create and returns a newRefItinstance from the specified objects.- Parameters:
it- an iterator that returns lines of a VCF filesampleFilter- a sample filter ornullmarkerFilter- a marker filter ornullbufferSize- the number of VCF records stored in a buffer- Returns:
- a new
RefItinstance - Throws:
java.lang.IllegalArgumentException- if a format error is detected in a line of a VCF file returned bystrIttjava.lang.IllegalArgumentException- ifbufferSize < 1java.lang.NullPointerException- ifstrIt == null
-
close
public void close()
Description copied from interface:FileItTerminates the iteration and releases any system resources that are held by this object. After invokingclose(), further invocations ofclose()have no effect.
-
hasNext
public boolean hasNext()
Returnstrueif the iteration has more elements, and returnsfalseotherwise.- Specified by:
hasNextin interfacejava.util.Iterator<RefGTRec>- Returns:
trueif the iteration has more elements
-
next
public RefGTRec next()
Returns the next element in the iteration.- Specified by:
nextin interfacejava.util.Iterator<RefGTRec>- Returns:
- the next element in the iteration
- Throws:
java.util.NoSuchElementException- if the iteration has no more elements
-
remove
public void remove()
Theremovemethod is not supported by this iterator.- Specified by:
removein interfacejava.util.Iterator<RefGTRec>- Throws:
java.lang.UnsupportedOperationException- if this method is invoked
-
file
public java.io.File file()
Description copied from interface:FileItReturns the file from which the data are read, ornullif the data are read from standard input or are computed data.
-
samples
public Samples samples()
Description copied from interface:SampleFileItReturns the list of samples.- Specified by:
samplesin interfaceSampleFileIt<RefGTRec>- Returns:
- the list of samples
-
toString
public java.lang.String toString()
Description copied from interface:FileItReturns a string representation ofthis. The exact details of the representation are unspecified and subject to change.
-
-