Skip to content

Commit

Permalink
Lots of small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmpage committed Oct 28, 2014
1 parent ac63693 commit c7ff5b0
Show file tree
Hide file tree
Showing 30 changed files with 361 additions and 13 deletions.
1 change: 1 addition & 0 deletions blast/maketree.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
$nexus .="begin paup;\n";
$nexus .=" [root trees at midpoint]\n";
$nexus .=" set rootmethod=midpoint;\n";
$nexus .=" set outroot=monophyl;\n";
$nexus .=" [construct tree using neighbour-joining]\n";
$nexus .=" nj;\n";
$nexus .=" [ensure branch lengths are output as substituions per nucleotide]\n";
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added course/phylogeny/images/circle.idraw
Binary file not shown.
39 changes: 39 additions & 0 deletions course/phylogeny/images/circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added course/phylogeny/images/circlephylogram.idraw
Binary file not shown.
37 changes: 37 additions & 0 deletions course/phylogeny/images/circlephylogram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added course/phylogeny/images/cladogram.idraw
Binary file not shown.
11 changes: 11 additions & 0 deletions course/phylogeny/images/cladogram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions course/phylogeny/images/download.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added course/phylogeny/images/g1001cc2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added course/phylogeny/images/phylogram.idraw
Binary file not shown.
16 changes: 16 additions & 0 deletions course/phylogeny/images/phylogram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added course/phylogeny/images/radial.idraw
Binary file not shown.
12 changes: 12 additions & 0 deletions course/phylogeny/images/radial.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added course/phylogeny/images/rectangle.idraw
Binary file not shown.
16 changes: 16 additions & 0 deletions course/phylogeny/images/rectangle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added course/projects/PETERS_DATABASE_version_1.xlsx
Binary file not shown.
16 changes: 15 additions & 1 deletion course/projects/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,28 @@ <h4>Reconciling taxonomic names</h4>
<h4>Name changes and obsolete labels</h4>
<p>How fast do taxonomic names change? What are the implications of this for people using these names? For example, for a public museum such as the Hunterian Zoology museum, how many names for the animals exhibited have changed since the labels were printed?</p>

<h4>Linking bird names to literature</h4>
<p>Avibase has a copy of Peter's checklist of birds of the world as an Excel spreadsheet, see
<a href="http://avibase.bsc-eoc.org/peterschecklist.jsp">The Peters' Check-list of the Birds of the World Database</a> (local copy <a href="PETERS_DATABASE_version_1.xlsx">here</a>).
Can you parse the text and locate the references online?</p>

<h3>Mapping</h3>

<h4>Where are new species being found?</h4>
<p>Find a list of recently described species (for example, follow a journal like <a href="https://twitter.com/zootaxa">Zootaxa</a> on Twitter, or <a href="https://species.wikimedia.org/wiki/Category:New_species_2014">Wikispecies</a>, and locate as many on a map. Comapare this to the distribution of protected area on <a href="http://protectedplanet.net">http://protectedplanet.net</a>.</p>
<p>Find a list of recently described species (for example, follow a journal like <a href="https://twitter.com/zootaxa">Zootaxa</a> on Twitter, or <a href="https://species.wikimedia.org/wiki/Category:New_species_2014">Wikispecies</a>, and locate as many on a map. Compare this to the distribution of protected area on <a href="http://protectedplanet.net">http://protectedplanet.net</a>.</p>

<h4>Extracting geographic data from papers</h4>
<p>A lot of geographic information is locked up in scientific papers. Can you write a regular expression to extract latitude and longitudes from a paper? Can you add this information to Google Earth?</p>

<h3>Conservation</h3>

<h4>How useful is GBIF for conservation?</h4>
<p>Take a number of species on the <a href="http://www.iucnredlist.org">IUCN Red List</a> and find them in <a href="http://www.gbif.org">GBIF</a>. Is there sufficient information in GBIF for you to assess the status of those species? You could investigate the use of <a href="http://geocat.kew.org">GeoCAT</a> using GBIF data. See also <a href="http://www.iucnredlistassessments.org">IUCN Red List assessments</a></p>

<h3>Ecological associations</h3>

<h4>Add data to Global Biotic Interactions (GloBI)</h4>
<p>Find a data set for ecological interactions (e.g., host and parasites) and add it to <a href="http://www.globalbioticinteractions.org/">Global Biotic Interactions (GloBI)</a>.</p>

<div id="disqus_thread"></div>
<script type="text/javascript">
Expand Down
14 changes: 11 additions & 3 deletions services/reconciliation_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function StoreHit($query_key, $hit)

//----------------------------------------------------------------------------------------------
// Handle an individual query
function OneQuery($query_key, $text, $limit = 1)
function OneQuery($query_key, $text, $limit = 1, $properties = null)
{

}
Expand All @@ -140,7 +140,13 @@ function Query($queries, $callback)
}
$this->result->${query_key}->result = array();

$this->OneQuery($query_key, $text, $limit);
$properties = null;
if (isset($query->properties))
{
$properties = $query->properties;
}

$this->OneQuery($query_key, $text, $limit, $properties);

if (count($this->result->${query_key}->result) == 0)
{
Expand All @@ -150,7 +156,9 @@ function Query($queries, $callback)

}

if (0)
// sort ?
if (1)
{
file_put_contents('tmp/r.txt', "Return: \n" . print_r($this->result, true), FILE_APPEND);
}
Expand Down
2 changes: 1 addition & 1 deletion services/reconciliation_envo.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function QueryInitialise()

//----------------------------------------------------------------------------------------------
// Handle an individual query
function OneQuery($query_key, $text, $limit = 5)
function OneQuery($query_key, $text, $limit = 5, $properties = null)
{
$param = array(
'partialName' => $text,
Expand Down
2 changes: 1 addition & 1 deletion services/reconciliation_eol.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function Types()

//----------------------------------------------------------------------------------------------
// Handle an individual query
function OneQuery($query_key, $text, $limit = 1)
function OneQuery($query_key, $text, $limit = 1, $properties = null)
{
$url = 'http://eol.org/api/search/1.0/' . rawurlencode($text) . '.json';

Expand Down
2 changes: 1 addition & 1 deletion services/reconciliation_gbif.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Types()

//----------------------------------------------------------------------------------------------
// Handle an individual query
function OneQuery($query_key, $text, $limit = 1)
function OneQuery($query_key, $text, $limit = 1, $properties = null)
{
$url = 'http://data.gbif.org/ws/rest/taxon/list?scientificname=' . urlencode($text) . '&dataresourcekey=1';

Expand Down
108 changes: 108 additions & 0 deletions services/reconciliation_gbif_dataset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?php

// GBIF dataset (with publisher UUID as ID property to narrow search)

require_once (dirname(__FILE__) . '/reconciliation_api.php');


//--------------------------------------------------------------------------------------------------
class GBIFDatasetService extends ReconciliationService
{
//----------------------------------------------------------------------------------------------
function __construct()
{
$this->name = 'GBIF Dataset';

$this->identifierSpace = 'http://www.gbif.org/';

$this->schemaSpace = 'http://rdf.freebase.com/ns/type.object.id';

$this->Types();

$view_url = 'http://www.gbif.org/dataset/{{id}}';

$preview_url = '';
$width = 430;
$height = 300;

if ($view_url != '')
{
$this->View($view_url);
}
if ($preview_url != '')
{
$this->Preview($preview_url, $width, $height);
}
}

//----------------------------------------------------------------------------------------------
function Types()
{
$type = new stdclass;
$type->id = '/common/topic';
$type->name = 'Freebase topic';
$this->defaultTypes[] = $type;
}

//----------------------------------------------------------------------------------------------
// Handle an individual query
function OneQuery($query_key, $text, $limit = 1, $properties = null)
{
$url = '';
if ($properties)
{
file_put_contents(dirname(__FILE__) . '/tmp/prop.txt', json_encode($properties), FILE_APPEND);

if ($properties[0]->pid == '/type/object/id')
{
// find datasets for this organisation
$url .= 'http://api.gbif.org/v1/organization/' . $properties[0]->v . '/publishedDataset';
}
else
{
// crude search
$url = 'http://api.gbif.org/v1/dataset?q=' . urlencode($text);
}


}
else
{
// crude search
$url = 'http://api.gbif.org/v1/dataset?q=' . urlencode($text);
}

file_put_contents(dirname(__FILE__) . '/tmp/url.txt', $url . "\n", FILE_APPEND);

$json = get($url);

if ($json != '')
{
$obj = json_decode($json);

foreach ($obj->results as $result)
{
$hit = new stdclass;
$hit->id = $result->key;
$hit->name = $result->title;
similar_text($text, $hit->name, $hit->score);
$hit->match = ($hit->score == 1);
$this->StoreHit($query_key, $hit);
}
}

}


}

$service = new GBIFDatasetService();

if (1)
{
file_put_contents(dirname(__FILE__) . '/tmp/publisher.txt', $_REQUEST['queries'], FILE_APPEND);
}

$service->Call($_REQUEST);

?>
Loading

0 comments on commit c7ff5b0

Please sign in to comment.