Skip to content

Commit

Permalink
lots of little changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmpage committed Jan 24, 2017
1 parent a540cfc commit 7268bdd
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Icon?
Thumbs.db

# tmp folders
eoliphone/tmp/
eoliphone/tmp/*
blast/tmp/
13 changes: 9 additions & 4 deletions blast/ncbi_blast.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function send_blast_job($gi)
"MEGABLAST" => "yes"
);

$html = post('http://blast.ncbi.nlm.nih.gov/Blast.cgi', $cmds);
$html = post('https://blast.ncbi.nlm.nih.gov/Blast.cgi', $cmds);

if (preg_match('/^ RID = (?<rid>.*)$/m', $html, $m))
{
Expand All @@ -68,6 +68,11 @@ function send_blast_job($gi)
{
$job->rtoe = $m['rtoe'];
}

if ($job->rtoe > 100)
{
$job->rtoe =20;
}

return $job;
}
Expand All @@ -82,7 +87,7 @@ function get_results($rid)
{
sleep(5);

$url = "http://www.ncbi.nlm.nih.gov/blast/Blast.cgi?CMD=Get&RID=$rid";
$url = "https://www.ncbi.nlm.nih.gov/blast/Blast.cgi?CMD=Get&RID=$rid";

$html = get($url);

Expand All @@ -109,7 +114,7 @@ function get_results($rid)
}
}

$url = "http://www.ncbi.nlm.nih.gov/blast/Blast.cgi?CMD=Get&RID=$rid&FORMAT_TYPE=XML";
$url = "https://www.ncbi.nlm.nih.gov/blast/Blast.cgi?CMD=Get&RID=$rid&FORMAT_TYPE=XML";
$result = get($url);

return $result;
Expand Down Expand Up @@ -138,7 +143,7 @@ function get_results($rid)
"QUERY" => $gi
);

$html = post('http://www.ncbi.nlm.nih.gov/blast/Blast.cgi', $cmds);
$html = post('https://www.ncbi.nlm.nih.gov/blast/Blast.cgi', $cmds);

//echo $html;

Expand Down
4 changes: 2 additions & 2 deletions course/geography/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h2><a name="background"/>Background</h2>

<h2><a name="lecture"/>Lecture</h2>

<div style="width:425px" id="__ss_11253521"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/rdmpage/geography-11253521" title="Geography">Geography</a></strong><object id="__sse11253521" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=geography-120125080546-phpapp02&stripped_title=geography-11253521&userName=rdmpage" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent"/><embed name="__sse11253521" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=geography-120125080546-phpapp02&stripped_title=geography-11253521&userName=rdmpage" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/rdmpage">Roderic Page</a>.</div></div>
<iframe src="//www.slideshare.net/slideshow/embed_code/key/IHNZrYvjwYXhAJ" width="595" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> <div style="margin-bottom:5px"> <strong> <a href="//www.slideshare.net/rdmpage/geography-11253521" title="Geography" target="_blank">Geography</a> </strong> from <strong><a target="_blank" href="//www.slideshare.net/rdmpage">Roderic Page</a></strong> </div>

<h2><a name="maps"/>Maps</h2>

Expand Down Expand Up @@ -171,7 +171,7 @@ <h2><a name="other"/>Other uses for maps</h2>

<h3>Maps and timelines</h3>

<p>Maps display data in space, but that spatial arrangement may change over time. There are a number of tools we can use to explore this. Google Earth itself supports timelines, as we can see with the avian flu example. Another useful tool is timemap, which creates a linked timeline and map display. For an example see the <a href="http://www.oe-files.de/gmaps/eqmashup.html" target="new">Live Earthquake Maship</a>.</p>
<p>Maps display data in space, but that spatial arrangement may change over time. There are a number of tools we can use to explore this. Google Earth itself supports timelines, as we can see with the avian flu example. Another useful tool is timemap, which creates a linked timeline and map display. For an example see the <a href="http://www.oe-files.de/gmaps/eqmashup.html" target="new">Live Earthquake Mashup</a>.</p>

<p>As an example, below is a timemap for swine flu. By scrolling through the timeline you can see the changes in geographic distribution of this disease.</p>

Expand Down
6 changes: 5 additions & 1 deletion course/introduction/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2>Background reading</h2>

<h2><a name="lecture"/>Lecture</h2>

<div style="width:425px" id="__ss_11218799"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/rdmpage/phyloinformatics-introduction" title="Phyloinformatics: Introduction">Phyloinformatics: Introduction</a></strong><object id="__sse11218799" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=introduction-120123103847-phpapp02&stripped_title=phyloinformatics-introduction&userName=rdmpage" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent"/><embed name="__sse11218799" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=introduction-120123103847-phpapp02&stripped_title=phyloinformatics-introduction&userName=rdmpage" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/rdmpage">Roderic Page</a>.</div></div>
<iframe src="//www.slideshare.net/slideshow/embed_code/key/nWKi1FNn7Jg0K7" width="595" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> <div style="margin-bottom:5px"> <strong> <a href="//www.slideshare.net/rdmpage/phyloinformatics-introduction" title="Phyloinformatics: Introduction" target="_blank">Phyloinformatics: Introduction</a> </strong> from <strong><a target="_blank" href="//www.slideshare.net/rdmpage">Roderic Page</a></strong> </div>

<p><a href="introduction.pptx">Slides</a></p>

Expand Down Expand Up @@ -167,6 +167,10 @@ <h3>RSS feeds</h3>
<img src="images/gmaps.png" />
</div>

<div class="warning">
Google has now disabled the old classic view. Based on an example <a href="https://developers.google.com/maps/documentation/javascript/examples/layer-georss">provided by Google</a> I've created a <a href="georss.html" target="_new">simple web page to display GeoRSS feeds</a>.
</div>

<div class="example">
<iframe src="http://player.vimeo.com/video/35517980?title=0&amp;byline=0&amp;portrait=0" width="398" height="403" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</div>
Expand Down
37 changes: 35 additions & 2 deletions course/taxonomy/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
background-color: rgb(222,222,222);
-webkit-border-radius: 10px;
}

.warning
{
margin:20px;
padding:20px;
background-color: #FFECAC;
border: 2px solid orange;
-webkit-border-radius: 10px;
}
</style>
<title>Taxonomy</title>
</head>
Expand All @@ -30,7 +39,7 @@ <h1>Taxonomy</h1>
<li><a href="#names">Names</a></li>
<li><a href="#classification">Classifications</a></li>
<li><a href="#next">Where next?</a></li>
<li><a href="#barcodes">Beyond names: DNA batcodes</a></li>
<li><a href="#barcodes">Beyond names: DNA barcodes</a></li>

</ul>

Expand Down Expand Up @@ -91,7 +100,7 @@ <h3><i>Drosophila melanogaster</i></h3>
<li>Restrict <i>Drosophila</i> to a monophyletic group that includes the type species (<i>D. funebris</i>)<br/>
(means <i>Drosophila melanogaster</i> can’t be <i>Drosophila melanogaster</i>)
<li>Change the type species to be <i>Drosophila melanogaster</i><br/>
(But nomenclature is not taxonomy, and ICZN said "no")</li>
(But nomenclature is not taxonomy, and ICZN said "no", see <a href="http://dx.doi.org/10.21805/bzn.v67i1.a14">doi:10.21805/bzn.v67i1.a14</a>)</li>
</ol>

<p>At core of argument is notion that Linnean names have to match phylogeny.</p>
Expand Down Expand Up @@ -141,6 +150,8 @@ <h3>Synonyms</h3>

<iframe width="560" height="315" src="//www.youtube.com/embed/xPqJkG2XhQ8?rel=0" frameborder="0" allowfullscreen></iframe>


<div class="warning">Synynyms is offline [2017]</div>
<div class="example">

<p>Ryan Schenk's <a href="http://synynyms.com/" target="_new">http://synynyms.com</a> tool displays the frequency of usage of taxonomic names in literature scanned by the <a href="http://www.biodiversitylibrary.org" target="_new">Biodiversity Heritage Library (BHL)</a>, and was inspired by Google's <a href="http://books.google.com/ngrams" target="_new">Ngram viewer</a>.</p>
Expand Down Expand Up @@ -242,6 +253,9 @@ <h3>Visualing classifications</h3>

<iframe src="http://player.vimeo.com/video/35704473?title=0&amp;byline=0&amp;portrait=0" width="398" height="333" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>


<div class="warning">EOL Treemap is offline [2017]</div>

<p>For a prettier verson see the <a href="http://synthesis.eol.org/media/treemap" target="_new">EOL Treemap</a>.</p>

<img src="images/eol.png" width="400"/>
Expand Down Expand Up @@ -272,6 +286,8 @@ <h3>Visualing classifications</h3>

<h3>Rates of discovery of new species over time</h3>

<div class="warning">Taxatoy is offline [2017]</div>

<p>There are various tools for viewing the rate of discovery of new species (more correctly, the rate at which new taxonomic names are published) over time, such as <a href="http://taxatoy.ubio.org/" target="_new">Taxatoy</a> described below. BioNames also has a timeline feature, which we can use to explore rates of new taxa being described.</p>

<div class="example">
Expand Down Expand Up @@ -323,6 +339,19 @@ <h2><a name="barcodes"/>Beyond names: DNA barcodes</h2>
<li><a href="http://bins.boldsystems.org" target="_new">Barcode of Life Database (BOLD)</a></li>
</ul>

<div class="example">
<b>Barcodes in GenBank</b>
<img src="images/image.png" />
<p>Below are two DNA barcodes that are also in GenBank. Look at each barcode, does Genbank treat them the same? If not, why not?</p>

<ul>
<li><a href="http://www.ncbi.nlm.nih.gov/nucleotide/HQ918292" target="_new">HQ918292</a></li>
<li><a href="http://www.ncbi.nlm.nih.gov/nucleotide/HQ918313" target="_new">HQ918313</a></li>
</ul>

</div>



<h3>Reading</h3>

Expand All @@ -347,6 +376,10 @@ <h3>Reading</h3>
<a href="http://blogs.scientificamerican.com/tetrapod-zoology/taxonomic-vandalism-and-hoser/">Taxonomic vandalism and the Raymond Hoser problem</a>
</li>

<li>
Opinion 2245 (Case 3407) Drosophila Fallén, 1823 (Insecta, Diptera): Drosophila funebris Fabricius, 1787 is maintained as the type species. (2010). The Bulletin of Zoological Nomenclature, 67(1), 106–115. <a href="http://dx.doi.org/10.21805/bzn.v67i1.a14" target="_new">doi:10.21805/bzn.v67i1.a14</a>
</li>


</ul>

Expand Down
2 changes: 1 addition & 1 deletion rss/barcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function uuid($prefix = '')
$taxon_id = $_GET['taxon_id'];
}

$url = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=nucleotide&term=barcode[keyword]+txid' . $taxon_id . '[Organism:exp]&retmax=10'; //&reldate=365&datetype=mdat';
$url = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=nucleotide&term=barcode[keyword]+txid' . $taxon_id . '[Organism:exp]&retmax=10'; //&reldate=365&datetype=mdat';


$xml = get($url);
Expand Down
8 changes: 6 additions & 2 deletions rss/genbank_fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ function process_locality(&$sequence)

if (isset($sequence->source->locality))
{
$matched = false;

// AY249471 Palmer Archipelago 64deg51.0'S, 63deg34.0'W
if (preg_match("/(?<latitude_degrees>[0-9]{1,2})deg(?<latitude_minutes>[0-9]{1,2}(\.\d+)?)'\s*(?<latitude_hemisphere>[S|N]),\s*(?<longitude_degrees>[0-9]{1,3})deg(?<longitude_minutes>[0-9]{1,2}(\.\d+)?)'\s*(?<longitude_hemisphere>[W|E])/", $sequence->source->locality, $matches))
{
Expand Down Expand Up @@ -372,7 +374,7 @@ function fetch_sequence($id)
$genbank_sequence = null;

// Query URL
$url = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id='
$url = 'https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nucleotide&id='
. $id
. '&rettype=gb&retmode=xml';

Expand Down Expand Up @@ -615,6 +617,8 @@ function fetch_sequence($id)

}

//print_r($genbank_sequence);

return $genbank_sequence;
}

Expand All @@ -629,7 +633,7 @@ function fetch_one($id)
//print_r($sequence);
}

if (0)
if (1)
{
$id = 'DQ502910';

Expand Down
34 changes: 22 additions & 12 deletions rss/nameparse.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function parse_name($fullname) {
}

if(in_array_norm($curr,$prefices)) {
if($out['last']) {
if(isset($out['last'])) {
$out['last'] .= " $curr";
}
else {
Expand All @@ -99,7 +99,7 @@ function parse_name($fullname) {
}

if($next == 'y' || $next == 'Y') {
if($out['last']) {
if(isset($out['last'])) {
$out['last'] .= " $curr";
}
else {
Expand All @@ -108,12 +108,12 @@ function parse_name($fullname) {
continue;
}

if($out['last']) {
if(isset($out['last'])) {
$out['last'] .= " $curr";
continue;
}

if($out['middle']) {
if(isset($out['middle'])) {
$out['middle'] .= " $curr";
}
else {
Expand All @@ -128,14 +128,23 @@ function parse_name($fullname) {
$n_subp = count($subp);
for($i = 0; $i < $n_subp; $i++) {
$curr = trim($subp[$i]);
$next = trim($subp[$i+1]);
//$next = trim($subp[$i+1]);
if ($i < $n_subp - 1)
{
$next = trim($subp[$i+1]);
}
else
{
$next = '';
}


if($i == 0 && in_array_norm($curr,$titles)) {
$out['title'] = $curr;
continue;
}

if(!$out['first']) {
if(!isset($out['first'])) {
$out['first'] = $curr;
continue;
}
Expand Down Expand Up @@ -170,12 +179,12 @@ function parse_name($fullname) {
continue;
}

if($out['last']) {
if(isset($out['last'])) {
$out['last'] .= " $curr";
continue;
}

if($out['middle']) {
if(isset($out['middle'])) {
$out['middle'] .= " $curr";
}
else {
Expand All @@ -189,15 +198,16 @@ function parse_name($fullname) {
$n_subp = count($subp);
for($i = 0; $i < $n_subp; $i++) {
$curr = trim($subp[$i]);
//$next = trim($subp[$i+1]);
//$next = trim($subp[$i+1]);
if ($i < $n_subp - 1)
{
$next = trim($subp[$i+1]);
}
else
{
$next = '';
}
}


if($i == 0 && in_array_norm($curr,$titles)) {
$out['title'] = $curr;
Expand All @@ -211,7 +221,7 @@ function parse_name($fullname) {

if($i == $n_subp-2 && $next &&
in_array_norm($next,$suffices)) {
if($out['middle']) {
if(isset($out['middle'])) {
$out['middle'] .= " $curr";
}
else {
Expand All @@ -226,7 +236,7 @@ function parse_name($fullname) {
continue;
}

if($out['middle']) {
if(isset($out['middle'])) {
$out['middle'] .= " $curr";
}
else {
Expand Down
17 changes: 17 additions & 0 deletions services/reconciliation_worms.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,23 @@ function OneQuery($query_key, $text, $limit = 1, $properties = null)
$hit->match = ($hit->score == 100);
$hit->id = $worms_result[0][$i]['AphiaID'];
$hit->name = $worms_result[0][$i]['scientificname'];


if (isset($worms_result[0][$i]['authority']))
{
$hit->authority = $worms_result[0][$i]['authority'];
}

$keys = array('kingdom','phylum','class','order','family','genus');

foreach ($keys as $k)
{
if (isset($worms_result[0][$i][$k]))
{
$hit->{$k} = $worms_result[0][$i][$k];
}
}

$this->StoreHit($query_key, $hit);
}
}
Expand Down

0 comments on commit 7268bdd

Please sign in to comment.