Commit 62ab0f20 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

javadoc added

parent a4b223d8
......@@ -13,6 +13,7 @@ import lcsb.mapviewer.annotation.cache.CachableInterface;
import lcsb.mapviewer.annotation.cache.XmlSerializer;
import lcsb.mapviewer.annotation.data.Drug;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
/**
* Abstract class with some functionalities used by class accessing drug
......@@ -68,6 +69,9 @@ public abstract class DrugAnnotation extends CachableInterface {
*
* @param target
* {@link MiriamData} describing target
* @param organisms
* list of organisms to which results should be limited (when no
* organisms defined filtering will be turned off)
* @return list of drugs
* @throws DrugSearchException
* thrown when there are problems with finding drug
......@@ -75,6 +79,15 @@ public abstract class DrugAnnotation extends CachableInterface {
public abstract List<Drug> getDrugListByTarget(MiriamData target, Collection<MiriamData> organisms) throws DrugSearchException;
/**
* Returns list of drugs that target protein.
*
* @param target
* {@link MiriamData} describing target
* @return list of drugs
* @throws DrugSearchException
* thrown when there are problems with finding drug
*/
public List<Drug> getDrugListByTarget(MiriamData target) throws DrugSearchException {
return getDrugListByTarget(target, new ArrayList<>());
}
......@@ -85,6 +98,9 @@ public abstract class DrugAnnotation extends CachableInterface {
*
* @param targets
* list of {@link MiriamData} describing targets
* @param organisms
* list of organisms to which results should be limited (when no
* organisms defined filtering will be turned off)
* @return list of drugs
* @throws DrugSearchException
* thrown when there are problems with connection to drug database
......@@ -111,6 +127,16 @@ public abstract class DrugAnnotation extends CachableInterface {
return result;
}
/**
* Returns list of drugs that target at least one protein from the parameter
* list.
*
* @param targets
* list of {@link MiriamData} describing targets
* @return list of drugs
* @throws DrugSearchException
* thrown when there are problems with connection to drug database
*/
public List<Drug> getDrugListByTargets(Collection<MiriamData> targets) throws DrugSearchException {
return getDrugListByTargets(targets, new ArrayList<>());
}
......@@ -132,6 +158,18 @@ public abstract class DrugAnnotation extends CachableInterface {
this.drugSerializer = drugSerializer;
}
/**
* Checks if organism name matches list of organisms.
*
* @param organismName
* name of the organism (should be something recognizable by
* {@link MiriamType#TAXONOMY} db).
* @param organisms
* list of organisms
* @return <code>false</code> if organisName couldn't be found in organisms
* list. If organismName is null or empty or list of organisms is
* empty true will be returned
*/
protected boolean organismMatch(String organismName, Collection<MiriamData> organisms) {
if (organismName == null || organismName.isEmpty() || organisms.size() == 0) {
return true;
......
......@@ -595,6 +595,9 @@ public class DrugbankHTMLParser extends DrugAnnotation implements IExternalServi
* identifier of the target using {@link MiriamType#HGNC_SYMBOL},
* used for verification if the target really points to proper
* protein/gene
* @param organisms
* list of organisms to which results should be limited (when no
* organisms defined filtering will be turned off)
* @return list of drugs that target this target
* @throws DrugSearchException
* thrown when there are problems with connection to DrugBank
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment