public class BEDReader
extends java.lang.Object
implements java.io.Closeable, java.lang.AutoCloseable
fam 文件是表型文件, 它是无标题行的以空格作为分隔符的文本文件, 包含 6 个强制列: 1. Family ID ('FID') 2. Within-family ID ('IID'; cannot be '0') 3. Within-family ID of father ('0' if father isn't in dataset) 4. Within-family ID of mother ('0' if mother isn't in dataset) 5. Sex code ('1' = male, '2' = female, '0' = unknown) 6. Phenotype value ('1' = control, '2' = case, '-9'/'0'/non-numeric = missing data if case/control) 在本类中, 多个表型会被储存在 ByteCodeArray 中
bim 文件是坐标文件, 它是无标题行的以空格作为分隔符的文本文件, 包含 6 个强制列: 1. Chromosome code (either an integer, or ‘X’/‘Y’/‘XY’/‘MT’; ‘0’ indicates unknown) or name 2. Variant identifier 3. Position in morgans or centimorgans (safe to use dummy value of ‘0’) 4. Base-pair coordinate (1-based; limited to 231-2) 5. Allele 1 (corresponding to clear bits in .bed; usually minor) 6. Allele 2 (corresponding to set bits in .bed; usually major) 在本类中, 超过 6 的列会被忽略
bed 文件是基因型文件, 它由 3 个强制的字节为开头的基因型编码格式
参考: https://www.cog-genomics.org/plink/1.9/formats#bed
构造器和说明 |
---|
BEDReader(java.lang.String fileName)
构造器方法
|
限定符和类型 | 方法和说明 |
---|---|
void |
close()
关闭文件流
|
Individual |
getIndividual(int index)
获取个体
|
int |
getIndividualNum()
获取个体数量
|
edu.sysu.pmglab.container.array.BaseArray<Individual> |
getIndividuals()
获取所有个体
|
boolean |
isClosed()
文件流是否被关闭
|
Variant |
read()
读取一个位点
|
void |
seek(long pointer)
指针跳转
该方法只能向后跳转, 如需自由跳转, 请使用 SeekableBEDReader
|
public BEDReader(java.lang.String fileName) throws java.io.IOException
fileName
- 文件名java.io.IOException
- IO 异常public edu.sysu.pmglab.container.array.BaseArray<Individual> getIndividuals()
public Individual getIndividual(int index)
index
- 个体索引public int getIndividualNum()
public Variant read() throws java.io.IOException
java.io.IOException
- IO 异常public void seek(long pointer) throws java.io.IOException
pointer
- 指定行数java.io.IOException
- IO 异常public void close() throws java.io.IOException
close
在接口中 java.io.Closeable
close
在接口中 java.lang.AutoCloseable
java.io.IOException
public boolean isClosed()