Search in sources :

Example 1 with BlastOutputIterations

use of gov.nih.nlm.ncbi.blast.BlastOutputIterations in project jvarkit by lindenb.

the class BlastMapAnnotations method printUniprot.

private void printUniprot(Uniprot uniprotSet) {
    if (uniprotSet.getEntry().isEmpty()) {
        LOG.warn("empty uniprot entry.");
        return;
    }
    if (uniprotSet.getEntry().size() > 1) {
        LOG.warn("entry contains more than one sequence.");
    }
    for (Entry entry : uniprotSet.getEntry()) {
        BlastOutputIterations iterations = this.blastOutput.getBlastOutputIterations();
        for (Iteration iteration : iterations.getIteration()) {
            for (FeatureType feature : entry.getFeature()) {
                if (!acceptfeature(feature.getType()))
                    continue;
                for (Hit hit : iteration.getIterationHits().getHit()) {
                    for (Hsp hsp : hit.getHitHsps().getHsp()) {
                        UniprotInterval bi = new UniprotInterval();
                        bi.entry = entry;
                        bi.featureType = feature;
                        bi.hit = hit;
                        bi.hsp = hsp;
                        LOG.debug("interval " + bi);
                        if (!bi.isFeatureOverlapHsp()) {
                            continue;
                        }
                        stdout().println(bi.toBedString());
                    }
                }
            }
            break;
        }
        break;
    }
// System.err.println("OK");
}
Also used : BlastOutputIterations(gov.nih.nlm.ncbi.blast.BlastOutputIterations) FeatureType(org.uniprot.FeatureType) Entry(org.uniprot.Entry) Hit(gov.nih.nlm.ncbi.blast.Hit) Hsp(gov.nih.nlm.ncbi.blast.Hsp) Iteration(gov.nih.nlm.ncbi.blast.Iteration)

Example 2 with BlastOutputIterations

use of gov.nih.nlm.ncbi.blast.BlastOutputIterations in project jvarkit by lindenb.

the class BlastMapAnnotations method printGB.

private void printGB(GBSet gbSet) {
    for (GBSeq gbSeq : gbSet.getGBSeq()) {
        BlastOutputIterations iterations = this.blastOutput.getBlastOutputIterations();
        for (Iteration iteration : iterations.getIteration()) {
            for (GBFeature feature : gbSeq.getGBSeqFeatureTable().getGBFeature()) {
                if (feature.getGBFeatureIntervals() == null)
                    continue;
                if (!acceptfeature(feature.getGBFeatureKey()))
                    continue;
                for (GBInterval interval : feature.getGBFeatureIntervals().getGBInterval()) {
                    for (Hit hit : iteration.getIterationHits().getHit()) {
                        for (Hsp hsp : hit.getHitHsps().getHsp()) {
                            GenbankInterval bi = new GenbankInterval();
                            bi.gbSeq = gbSeq;
                            bi.gbFeature = feature;
                            bi.gbInterval = interval;
                            bi.hit = hit;
                            bi.hsp = hsp;
                            LOG.debug("interval " + bi);
                            if (!bi.isGbForward())
                                LOG.info("CHECK INTERVAL REVERSE");
                            if (!bi.isFeatureOverlapHsp())
                                continue;
                            stdout().println(bi.toBedString());
                        }
                    }
                }
            }
            break;
        }
    }
// System.err.println("OK");
}
Also used : BlastOutputIterations(gov.nih.nlm.ncbi.blast.BlastOutputIterations) Hit(gov.nih.nlm.ncbi.blast.Hit) GBSeq(gov.nih.nlm.ncbi.gb.GBSeq) Hsp(gov.nih.nlm.ncbi.blast.Hsp) GBFeature(gov.nih.nlm.ncbi.gb.GBFeature) Iteration(gov.nih.nlm.ncbi.blast.Iteration) GBInterval(gov.nih.nlm.ncbi.gb.GBInterval)

Aggregations

BlastOutputIterations (gov.nih.nlm.ncbi.blast.BlastOutputIterations)2 Hit (gov.nih.nlm.ncbi.blast.Hit)2 Hsp (gov.nih.nlm.ncbi.blast.Hsp)2 Iteration (gov.nih.nlm.ncbi.blast.Iteration)2 GBFeature (gov.nih.nlm.ncbi.gb.GBFeature)1 GBInterval (gov.nih.nlm.ncbi.gb.GBInterval)1 GBSeq (gov.nih.nlm.ncbi.gb.GBSeq)1 Entry (org.uniprot.Entry)1 FeatureType (org.uniprot.FeatureType)1