Added getParents() -> returns an arrayList containing the sample's parent(s) if available
This commit is contained in:
parent
aad99563be
commit
76dd816e70
|
|
@ -3,6 +3,7 @@ package org.broadinstitute.sting.gatk.samples;
|
|||
|
||||
import org.broadinstitute.sting.utils.exceptions.UserException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -110,6 +111,17 @@ public class Sample implements Comparable<Sample> { // implements java.io.Serial
|
|||
return infoDB.getSample(paternalID);
|
||||
}
|
||||
|
||||
public ArrayList<Sample> getParents(){
|
||||
ArrayList<Sample> parents = new ArrayList<Sample>(2);
|
||||
Sample parent = getMother();
|
||||
if(parent != null)
|
||||
parents.add(parent);
|
||||
parent = getFather();
|
||||
if(parent != null)
|
||||
parents.add(parent);
|
||||
return parents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get gender of the sample
|
||||
* @return property of key "gender" - must be of type Gender
|
||||
|
|
|
|||
Loading…
Reference in New Issue