Example #1
0
func (s *RegrSuite) SetUpTest(c *C) {
	s.h = vcfgo.NewHeader()
	s.h.Infos["DOCM_DISEASE"] = &vcfgo.Info{Id: "DOCM_DISEASE", Description: "DOCM_DISEASE", Type: "String", Number: "."}
	s.h.Infos["DOCM_PMIDS"] = &vcfgo.Info{Id: "DOCM_PMIDS", Description: "DOCM_PMIDS", Type: "String", Number: "."}

	s.v1 = makeVariant("1", 22, "A", []string{"T"}, "query", "", s.h)
	s.v1.SetSource(0)
	s.v2 = makeVariant("1", 22, "A", []string{"T"}, "docm", "DOCM_DISEASE=chronic_myeloid_leukemia,acute_myeloid_leukemia;DOCM_PMIDS=23634996,23656643", s.h)
	s.v2.SetSource(1)

	s.src_disease = Source{
		File:  "docm.vcf.gz",
		Op:    "concat",
		Field: "DOCM_DISEASE",
		Name:  "docm_disease",
		Index: 0,
	}

	s.src_pmids = Source{
		File:  "docm.vcf.gz",
		Op:    "uniq",
		Field: "DOCM_PMIDS",
		Name:  "docm_pmids",
		Index: 0,
	}

	s.v1.AddRelated(s.v2)

	empty := make([]PostAnnotation, 0)
	s.annotator = NewAnnotator([]*Source{&s.src_disease, &s.src_pmids}, "", true, false, empty)

}
Example #2
0
// vFromB makes a variant from an interval. this helps avoid code duplication.
func vFromB(b *parsers.Interval) *parsers.Variant {
	h := vcfgo.NewHeader()
	h.Infos["SVLEN"] = &vcfgo.Info{Id: "SVLEN", Type: "Integer", Description: "", Number: "1"}
	m := vcfgo.NewInfoByte([]byte(fmt.Sprintf("SVLEN=%d", int(b.End()-b.Start())-1)), h)
	v := parsers.NewVariant(&vcfgo.Variant{Chromosome: b.Chrom(), Pos: uint64(b.Start() + 1),
		Reference: "A", Alternate: []string{"<DEL>"}, Info_: m}, 0, b.Related())
	return v
}
Example #3
0
type APISuite struct {
	sv1 *parsers.Variant
	v1  *parsers.Variant
	v2  *parsers.Variant
	v3  *parsers.Variant

	bed *parsers.Interval

	src  Source
	src0 Source

	annotator *Annotator
}

var _ = Suite(&APISuite{})
var h = vcfgo.NewHeader()

var v1 = &vcfgo.Variant{
	Chromosome: "chr1",
	Pos:        uint64(234),
	Id_:        "id",
	Reference:  "A",
	Alternate:  []string{"T", "G"},
	Quality:    float32(555.5),
	Filter:     "PASS",
	Info_:      vcfgo.NewInfoByte([]byte("DP=35"), h),
}
var sv1 = &vcfgo.Variant{
	Chromosome: "chr1",
	Pos:        uint64(230),
	Id_:        "id",