All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.charite.compbio.jannovar.pedigree.PedFileContents Maven / Gradle / Ivy

There is a newer version: 0.41
Show newest version
package de.charite.compbio.jannovar.pedigree;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;

import de.charite.compbio.jannovar.Immutable;

/**
 * Represents the contents of a pedigree file.
 *
 * @author Manuel Holtgrewe
 */
@Immutable
public class PedFileContents {

	/** headers for extra columns (column 7 and beyond) */
	private final ImmutableList extraColumnHeaders;

	/** the individuals in the PED file */
	private final ImmutableList individuals;

	/** mapping of name to PedPerson */
	private final ImmutableMap nameToPerson; // TODO(holtgrew): Test this!

	public PedFileContents(ImmutableList extraColumnHeaders, ImmutableList individuals) {
		this.extraColumnHeaders = extraColumnHeaders;
		this.individuals = individuals;

		ImmutableMap.Builder builder = new ImmutableMap.Builder();
		for (PedPerson p : individuals)
			builder.put(p.getName(), p);
		this.nameToPerson = builder.build();
	}

	/** @return headers for extra columns (column 7 and beyond) */
	public ImmutableList getExtraColumnHeaders() {
		return extraColumnHeaders;
	}

	/** @return the individuals in the PED file */
	public ImmutableList getIndividuals() {
		return individuals;
	}

	/** @return mapping of name to PedPerson */
	public ImmutableMap getNameToPerson() {
		return nameToPerson;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy