Package vcf
Class RefIt
java.lang.Object
vcf.RefIt
- All Implemented Interfaces:
FileIt<RefGTRec>,SampleFileIt<RefGTRec>,VcfFileIt<RefGTRec>,Closeable,AutoCloseable,Iterator<RefGTRec>
Class RefIt represents an iterator whose next()
method returns an object storing data from a VCF record with
phased, non-missing genotypes.
Instances of class RefIt are 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
Modifier and TypeMethodDescriptionvoidclose()Closes the input stream and releases any system resources that are associated with it.static RefItCreate and returns a newRefItinstance from the specified iterator.static RefItCreate and returns a newRefItinstance from the specified objects.static RefItCreate and returns a newRefItinstance from the specified objects.file()Returns the file from which the data are read, ornullif the data are read from standard input or if the data source is unknown.booleanhasNext()Returnstrueif the iteration has more elements, and returnsfalseotherwise.next()Returns the next element in the iteration.voidremove()Theremovemethod is not supported by this iterator.samples()Returns the list of samples.toString()Returns a string representation ofthis.Returns the VCF meta-information lines and header lineMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Method Details
-
create
Create and returns a newRefItinstance from the specified iterator.- Parameters:
it- an iterator that returns lines of a VCF file- Returns:
- a new
RefItinstance - Throws:
IllegalArgumentException- if a format error is detected in a line of a VCF file returned byitNullPointerException- ifit == null
-
create
public static RefIt create(FileIt<String> it, Filter<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:
IllegalArgumentException- if a format error is detected in a line of a VCF file returned byitIllegalArgumentException- ifbufferSize < 1NullPointerException- ifit == null
-
create
public static RefIt create(FileIt<String> it, Filter<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:
IllegalArgumentException- if a format error is detected in a line of a VCF file returned byitIllegalArgumentException- ifbufferSize < 1NullPointerException- ifit == null
-
close
public void close()Description copied from interface:FileItCloses the input stream and releases any system resources that are associated with it. If the input stream is already closed then invoking this method has no effect. -
hasNext
public boolean hasNext()Returnstrueif the iteration has more elements, and returnsfalseotherwise. -
next
Returns the next element in the iteration.- Specified by:
nextin interfaceIterator<RefGTRec>- Returns:
- the next element in the iteration
- Throws:
NoSuchElementException- if the iteration has no more elements
-
remove
public void remove()Theremovemethod is not supported by this iterator.- Specified by:
removein interfaceIterator<RefGTRec>- Throws:
UnsupportedOperationException- if this method is invoked
-
file
Description copied from interface:FileItReturns the file from which the data are read, ornullif the data are read from standard input or if the data source is unknown. -
samples
Description copied from interface:SampleFileItReturns the list of samples.- Specified by:
samplesin interfaceSampleFileIt<RefGTRec>- Returns:
- the list of samples
-
vcfHeader
Description copied from interface:VcfFileItReturns the VCF meta-information lines and header line -
toString
Description copied from interface:FileItReturns a string representation ofthis. The exact details of the representation are unspecified and subject to change.
-