示例#1
0
        public void WriteReads(string readsetId, string chr, ulong pos1, ulong pos2, Action <IList <Read> > writeAction)
        {
            var _genomicsService    = CreateService();
            var _searchReadsRequest = new SearchReadsRequest
            {
                ReadsetIds    = new[] { readsetId },
                SequenceName  = chr,
                SequenceStart = pos1,
                SequenceEnd   = pos2,
                MaxResults    = 1024
            };

            do
            {
                var _rq = _genomicsService.Reads.Search(_searchReadsRequest);
                var _rs = _rq.Execute();
                _searchReadsRequest.PageToken = _rs.NextPageToken;
                writeAction(_rs.Reads);
                HttpContext.Current.Response.Flush();
            } while (_searchReadsRequest.PageToken != null);
        }
示例#2
0
        /// <summary>
        /// Gets a list of reads for one or more read group sets.For the definitions of read group sets and other genomics resources, see[Fundamentals of GoogleGenomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)Reads search operates over a genomic coordinate space of reference sequence& position defined over the reference sequences to which the requestedread group sets are aligned.If a target positional range is specified, search returns all reads whosealignment to the reference genome overlap the range. A query whichspecifies only read group set IDs yields all reads in those read groupsets, including unmapped reads.All reads returned (including reads on subsequent pages) are ordered bygenomic coordinate (by reference sequence, then position). Reads withequivalent genomic coordinates are returned in an unspecified order. Thisorder is consistent, such that two queries for the same content (regardlessof page size) yield reads in the same order across their respective streamsof paginated responses.Implements[GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85).
        /// Documentation https://developers.google.com/genomics/v1/reference/reads/search
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Genomics service.</param>
        /// <param name="body">A valid Genomics v1 body.</param>
        /// <returns>SearchReadsResponseResponse</returns>
        public static SearchReadsResponse Search(GenomicsService service, SearchReadsRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }

                // Make the request.
                return(service.Reads.Search(body).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Reads.Search failed.", ex);
            }
        }
示例#3
0
        public List <Read> SearchReads(string readsetId, string chr, ulong pos1, ulong pos2)
        {
            var _res                = new List <Read>();
            var _genomicsService    = CreateService();
            var _searchReadsRequest = new SearchReadsRequest
            {
                ReadsetIds    = new[] { readsetId },
                SequenceName  = chr,
                SequenceStart = pos1,
                SequenceEnd   = pos2,
                MaxResults    = 1024
            };

            do
            {
                var _rq = _genomicsService.Reads.Search(_searchReadsRequest);
                var _rs = _rq.Execute();
                _searchReadsRequest.PageToken = _rs.NextPageToken;
                _res.AddRange(_rs.Reads);
            } while (_searchReadsRequest.PageToken != null);

            return(_res);
        }