{"id":201,"date":"2023-07-21T12:16:33","date_gmt":"2023-07-21T11:16:33","guid":{"rendered":"https:\/\/wordpress.vdjbase.org\/?p=201"},"modified":"2025-08-15T15:15:25","modified_gmt":"2025-08-15T14:15:25","slug":"downloading-germline-sets-from-the-command-line-or-api","status":"publish","type":"post","link":"https:\/\/wordpress.vdjbase.org\/index.php\/ogrdb_news\/downloading-germline-sets-from-the-command-line-or-api\/","title":{"rendered":"Downloading germline sets from the command line or API"},"content":{"rendered":"\n<p>In this post, we&#8217;re going to look briefly at the different ways that you can download germline sets from the command line, or from code. We want to make germline sets on OGRDB as easy to work with as possible, and making them available for download conveniently is an important part of that, so that they can be kept up to date in websites, tools, and other applications.<\/p>\n\n\n\n<p>If you hover over a download button on a <a href=\"https:\/\/ogrdb.airr-community.org\/germline_sets\/Human\">page listing germline sets<\/a>, you will see a link similar to this one:<\/p>\n\n\n\n<p><a href=\"https:\/\/ogrdb.airr-community.org\/download_germline_set\/Human\/IGH_VDJ\/published\/gapped_ex\">https:\/\/ogrdb.airr-community.org\/download_germline_set\/Human\/IGH_VDJ\/published\/gapped_ex<\/a><\/p>\n\n\n\n<p>You can use these links at the command line:<\/p>\n\n\n\n<p>&gt;<code>curl https:\/\/ogrdb.airr-community.org\/download_germline_set\/Human\/IGH_VDJ\/published\/ga<\/code>pped_ex<br>IGHD1-1*01<br>GGTACAACTGGAACGAC<br>\u2026<\/p>\n\n\n\n<p>We\u2019ll explore the anatomy of this link in a while, but before covering that, let\u2019s explore one other option, and why you might want to use it. The link above is really intended for use on the OGRDB web site, and won\u2019t give an easy-to-process error if something goes wrong. For that reason, it may be better to use a link from the <a href=\"https:\/\/ogrdb.airr-community.org\/api\/\">OGRDB REST API<\/a>, which has exactly the same form but a slightly different prefix:<br><br>><code>curl https:\/\/ogrdb.airr-community.org\/api\/germline\/set\/Human\/IGH_VDJ\/published\/ga<\/code>pped_ex<br>IGHD1-1*01<br>GGTACAACTGGAACGAC<br>\u2026<br><\/p>\n\n\n\n<p>If we request a nonexistent germline set, for example, through the API, the response code will be 404 and the status will be easy to process:<\/p>\n\n\n\n<p><code>curl https:\/\/ogrdb.airr-community.org\/api\/germline\/set\/Human\/IGH_XXX\/published\/gapped_ex<br>{<br>\"error\": \"Set not found\"<br>}<\/code><\/p>\n\n\n\n<p>The <a href=\"https:\/\/ogrdb.airr-community.org\/api\/\" data-type=\"URL\" data-id=\"https:\/\/ogrdb.airr-community.org\/api\/\">REST API<\/a> has calls that you can use to list the species for which OGRDB has sets available, the sets themselves, versions available and so on. You can browse the api, and experiment with it, by <a href=\"https:\/\/ogrdb.airr-community.org\/api\/\" data-type=\"URL\" data-id=\"https:\/\/ogrdb.airr-community.org\/api\/\">following the link<\/a>. However, if you just want a link to a particular set, it may be easier just to take the download link from the download button on the lists page, and swap the segment <code>download_germline_set\/<\/code> for <code>api\/germline\/set\/<\/code>.<\/p>\n\n\n\n<p>The germline set links have five components:<\/p>\n\n\n\n<p>species \u2013 the species as used within OGRDB. OGRDB uses informal species names, such as Human and Mouse. The first letter is capitalised.<\/p>\n\n\n\n<p>species_subgroup- this may designate a strain, breed, or some other species subgroup, for example BALB\/c for Mouse. Because of the way that slashes are processed by our web server, if the species_subgroup contains slashes, they must be replaced in the link with the string %252f, so that BALB\/c would become BALB%252fc. If no species_subgroup is applicable for the germline set, this component is left out, meaning that the link will have four components rather than five.<\/p>\n\n\n\n<p>name \u2013 the name of the germline set. As above, if this contains slashes, %252f should be used in place of the slash.<\/p>\n\n\n\n<p>revision_number \u2013 this is the revision number of the set, if a specific revision is desired, or \u2018published\u2019 or \u2018latest\u2019 to obtain the currently published version.<\/p>\n\n\n\n<p>format \u2013 one of airr, gapped, ungapped to retrieve the AIRR-C format, or gapped\/ungapped FASTA formats. For Human sets, \u2018_ex\u2019 should be added to retrieve the Reference Set. Without the \u2018_ex\u2019, the Source Set will be retrieved.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we&#8217;re going to look briefly at the different ways that you can download germline sets from the command line, or from code. We want to make germline sets on OGRDB as easy to work with as possible, and making them available for download conveniently is an important part of that, so that&hellip; <a class=\"more-link\" href=\"https:\/\/wordpress.vdjbase.org\/index.php\/ogrdb_news\/downloading-germline-sets-from-the-command-line-or-api\/\">Continue reading <span class=\"screen-reader-text\">Downloading germline sets from the command line or API<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[19],"class_list":["post-201","post","type-post","status-publish","format-standard","hentry","category-ogrdb_news","tag-howto","entry"],"_links":{"self":[{"href":"https:\/\/wordpress.vdjbase.org\/index.php\/wp-json\/wp\/v2\/posts\/201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.vdjbase.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.vdjbase.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.vdjbase.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.vdjbase.org\/index.php\/wp-json\/wp\/v2\/comments?post=201"}],"version-history":[{"count":11,"href":"https:\/\/wordpress.vdjbase.org\/index.php\/wp-json\/wp\/v2\/posts\/201\/revisions"}],"predecessor-version":[{"id":238,"href":"https:\/\/wordpress.vdjbase.org\/index.php\/wp-json\/wp\/v2\/posts\/201\/revisions\/238"}],"wp:attachment":[{"href":"https:\/\/wordpress.vdjbase.org\/index.php\/wp-json\/wp\/v2\/media?parent=201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.vdjbase.org\/index.php\/wp-json\/wp\/v2\/categories?post=201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.vdjbase.org\/index.php\/wp-json\/wp\/v2\/tags?post=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}