ae88abbaeb5f248692b8610e717d80988e600ce8 lrnassar Fri May 17 09:56:55 2019 -0700 Little fixes to api.html examples #18866 diff --git src/hg/htdocs/goldenPath/help/api.html src/hg/htdocs/goldenPath/help/api.html index 188cc5c..d045623 100755 --- src/hg/htdocs/goldenPath/help/api.html +++ src/hg/htdocs/goldenPath/help/api.html @@ -284,71 +284,72 @@ When querying track data with the /getData/track function, the jsonOutputArrays can be used in conjunction to see the track schema. This includes a description of each field present in the track. The data will also be returned in JSON array type.
Request data from hg38 gold track in array type -
api.genome.ucsc.edu/getData/track?genome=hg38;track=gold;chrom=chrM;jsonOutputArrays=1
When using the /list/tracks function to see the available tracks in an assembly, it can be useful to return all tracks in the same hierarchical level. By default, composite and supertracks will have the subtracks nested below, however, the trackLeavesOnly=1 parameter -can be passed to hide the container information, and display all tracks and subtracks at the +can be passed to hide the container information and display all tracks and subtracks at the same level.
-In the following example, the first link does not include the trackLeavesOnly parameter. The -output can be compared to the second link to see the difference. This can be observed in the -conservation track. In the first link, the multiz20way track is nested within the cons20way -track. In the second link, however, the multiz20way subtrack is seen at an equivelant level -with all other tracks, and the container, cons20way, is not present in the list.
+In the following example, the first link does not include the trackLeavesOnly parameter. The +output can be compared to the second link to see the difference, which can be observed in the +conservation track. In the first link, the multiz20way track is nested within the +cons20way track. In the second link, however, the multiz20way subtrack is seen at +an equivelant level with all other tracks, and the container, cons20way, is not +present in the list.
Request available tracks in the rn6 genome -
api.genome.ucsc.edu/list/tracks?genome=rn6
Request available tracks in the rn6 genome, hiding container information -
api.genome.ucsc.edu/list/tracks?genome=rn6;trackLeavesOnly=1
Certain tracks may contain over 1M items. When these tracks are queried using the /getData/track function, only the first million items are returned. The API assumes -this default value of 1M unless a different value (less than 1M) is specified in the +this default value of 1M unless a different value (less than 1M) is specified with the parameter maxItemsOutput.
-One of these tracks is the knownGene track for hg19. Removing the maxItemsOutput +One of these tracks is the knownGene track for hg19. Removing the maxItemsOutput parameter from the following link will lead to a 384Mb download, and may cause certain web browsers to time out.
Request items in knownGene track of hg19, remove maxItemsOutput parameter for 1M max return -
api.genome.ucsc.edu/getData/track?genome=hg19;track=knownGene;maxItemsOutput=5
There are different ways around this item limit, depending on how many items are in the track. For -the knownGene track, breaking it down to component chromosome queries using the chrom +the knownGene track, breaking it down to component chromosome queries using the chrom parameter will suffice. In order to get a listing of the chrom names, and what chroms have data for that track, the /list/chromosomes function can be used.
Request listing of chroms that have data for the knownGene track in hg19 -
api.genome.ucsc.edu/list/chromosomes?genome=hg19;track=knownGene
With the list of chrom names that have data, the /getData/track function can be used again while specifying the chrom parameter. In the following example chr1 is queried and the itemsReturned field shows a total of 7967 items in the output. Well below the 1M limit, meaning all data for chr1 has been extracted. This can then be repeated for all chroms of interest.