{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Add Mimicry Group Information for Heliconius Species\n", "\n", "This notebook will add mimicry group information for the Heliconius species (at the subspecies level) included in this dataset." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Load in master CSVs and Heliconius mimicry group csvs." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Master CSVs\n", "full_df = pd.read_csv(\"../Jiggins_Zenodo_Img_Master.csv\", low_memory = False)\n", "dorsal_df = pd.read_csv(\"../Jiggins_Zenodo_dorsal_Img_Master.csv\", low_memory = False)\n", "heli_df = pd.read_csv(\"../Jiggins_Heliconius_Master.csv\", low_memory = False)\n", "\n", "# Heliconius Mimicry Group CSV\n", "mimic_gp_df = pd.read_csv(\"../metadata/heliconius_mimic_groups.csv\", low_memory = False)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['CAMID', 'X', 'Image_name', 'View', 'zenodo_name', 'zenodo_link',\n", " 'Sequence', 'Taxonomic_Name', 'Locality', 'Sample_accession',\n", " 'Collected_by', 'Other_ID', 'Date', 'Dataset', 'Store', 'Brood',\n", " 'Death_Date', 'Cross_Type', 'Stage', 'Sex', 'Unit_Type', 'file_type',\n", " 'record_number', 'species', 'subspecies', 'genus', 'file_url',\n", " 'hybrid_stat', 'filename', 'filepath', 'md5'],\n", " dtype='object')" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "full_df.columns" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First, we need to fix a typo found in the subspecies (\"clysonomus\" should be \"clysonymus\")." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "136" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "full_df.loc[full_df[\"subspecies\"] == \"clysonymus\"].shape[0]" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | CAMID | \n", "X | \n", "Image_name | \n", "View | \n", "zenodo_name | \n", "zenodo_link | \n", "Sequence | \n", "Taxonomic_Name | \n", "Locality | \n", "Sample_accession | \n", "... | \n", "file_type | \n", "record_number | \n", "species | \n", "subspecies | \n", "genus | \n", "file_url | \n", "hybrid_stat | \n", "filename | \n", "filepath | \n", "md5 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24962 | \n", "CAM041233 | \n", "14103 | \n", "CAM041233_d.JPG | \n", "dorsal | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,233 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Wild Sumaco Hummingbird Trail | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14103_CAM041233_d.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "2236af310ed7d7027cbec678a636b5ee | \n", "
24963 | \n", "CAM041233 | \n", "14104 | \n", "CAM041233_v.JPG | \n", "ventral | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,233 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Wild Sumaco Hummingbird Trail | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14104_CAM041233_v.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "d45a9ef82f9cd4646c4ea51e266b2814 | \n", "
24964 | \n", "CAM041234 | \n", "14105 | \n", "CAM041234_d.JPG | \n", "dorsal | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,234 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Wild Sumaco Hummingbird Trail | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14105_CAM041234_d.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "2c19b958ad77e448d7ad2ad41273bb65 | \n", "
24965 | \n", "CAM041234 | \n", "14106 | \n", "CAM041234_v.JPG | \n", "ventral | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,234 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Wild Sumaco Hummingbird Trail | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14106_CAM041234_v.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "8249c142e90bda050accab7e59e9821d | \n", "
24966 | \n", "CAM041235 | \n", "14107 | \n", "CAM041235_d.JPG | \n", "dorsal | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,235 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Wild Sumaco Hummingbird Trail | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14107_CAM041235_d.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "a988e503bbe0404e07c89405c05e0f9d | \n", "
24967 | \n", "CAM041235 | \n", "14108 | \n", "CAM041235_v.JPG | \n", "ventral | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,235 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Wild Sumaco Hummingbird Trail | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14108_CAM041235_v.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "495869bf772c8d4d95b07620d3e3c6dd | \n", "
24968 | \n", "CAM041236 | \n", "14109 | \n", "CAM041236_d.JPG | \n", "dorsal | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,236 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Wild Sumaco Hummingbird Trail | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14109_CAM041236_d.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "15f796491b44543453b6f7ce0311c9dc | \n", "
24969 | \n", "CAM041236 | \n", "14110 | \n", "CAM041236_v.JPG | \n", "ventral | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,236 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Wild Sumaco Hummingbird Trail | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14110_CAM041236_v.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "20684478a650287e49f64675deb80ed6 | \n", "
25055 | \n", "CAM041280 | \n", "14196 | \n", "CAM041280_d.JPG | \n", "dorsal | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,280 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Reventador road | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14196_CAM041280_d.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "9363c286d5fb4790b99fd2bc2fe8aaad | \n", "
25056 | \n", "CAM041280 | \n", "14197 | \n", "CAM041280_v.JPG | \n", "ventral | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,280 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Reventador road | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14197_CAM041280_v.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "9085c0f1bb0230d7ccc9089f1a299aed | \n", "
25057 | \n", "CAM041281 | \n", "14198 | \n", "CAM041281_d.JPG | \n", "dorsal | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,281 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Reventador road | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14198_CAM041281_d.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "d371321547ec020347275e7b89cf6af2 | \n", "
25058 | \n", "CAM041281 | \n", "14199 | \n", "CAM041281_v.JPG | \n", "ventral | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,281 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Reventador road | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14199_CAM041281_v.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "13e5a78afa77e0b1fb238377600fc9b8 | \n", "
25059 | \n", "CAM041282 | \n", "14201 | \n", "CAM041282_v.JPG | \n", "ventral | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,282 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Reventador road | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14201_CAM041282_v.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "922f2db6299e004bcb09906f99c038ba | \n", "
25060 | \n", "CAM041282 | \n", "14200 | \n", "CAM041282_d.JPG | \n", "dorsal | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,282 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Reventador road | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14200_CAM041282_d.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "8b40ba830d38f9f4061a63a854c86404 | \n", "
25061 | \n", "CAM041283 | \n", "14203 | \n", "CAM041283_v.JPG | \n", "ventral | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,283 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Reventador road | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14203_CAM041283_v.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "349520a30aee4bb098789b0b24d0a288 | \n", "
25062 | \n", "CAM041283 | \n", "14202 | \n", "CAM041283_d.JPG | \n", "dorsal | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,283 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Reventador road | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14202_CAM041283_d.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "810791d8777381676724cbee09f4c9b6 | \n", "
25063 | \n", "CAM041284 | \n", "14204 | \n", "CAM041284_d.JPG | \n", "dorsal | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,284 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Reventador road | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14204_CAM041284_d.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "040da0a338a3318baef1de8f275912dd | \n", "
25064 | \n", "CAM041284 | \n", "14205 | \n", "CAM041284_v.JPG | \n", "ventral | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,284 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Reventador road | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14205_CAM041284_v.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "955d38ec86c457378e8b9e1a8a3776f8 | \n", "
25065 | \n", "CAM041285 | \n", "14206 | \n", "CAM041285_d.JPG | \n", "dorsal | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,285 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Reventador road | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14206_CAM041285_d.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "2af97a0ad748065aecc88dfa1649c51c | \n", "
25066 | \n", "CAM041285 | \n", "14207 | \n", "CAM041285_v.JPG | \n", "ventral | \n", "CAM.coll.images.batch9.csv | \n", "https://zenodo.org/record/2714333 | \n", "41,285 | \n", "Heliconius clysonomus ssp. clysonomus | \n", "Reventador road | \n", "NaN | \n", "... | \n", "jpg | \n", "2714333 | \n", "Heliconius clysonomus | \n", "clysonomus | \n", "Heliconius | \n", "https://zenodo.org/record/2714333/files/CAM041... | \n", "non-hybrid | \n", "14207_CAM041285_v.JPG | \n", "images/Heliconius clysonomus ssp. clysonomus/1... | \n", "24acf462d66c712f3be5aab7f1c85b6e | \n", "
20 rows × 31 columns
\n", "\n", " | CAMID | \n", "X | \n", "Image_name | \n", "View | \n", "zenodo_name | \n", "zenodo_link | \n", "Sequence | \n", "Taxonomic_Name | \n", "Locality | \n", "Sample_accession | \n", "... | \n", "file_type | \n", "record_number | \n", "species | \n", "subspecies | \n", "genus | \n", "file_url | \n", "hybrid_stat | \n", "filename | \n", "filepath | \n", "md5 | \n", "
---|
0 rows × 31 columns
\n", "\n", " | subspecies | \n", "group1 | \n", "group2_if_polymorphic | \n", "group3_if_polymorphic | \n", "Unnamed: 4 | \n", "
---|---|---|---|---|---|
0 | \n", "cythera | \n", "cyrbia | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
1 | \n", "cyrbia | \n", "cyrbia | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
2 | \n", "venus | \n", "postman | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
3 | \n", "vulcanus | \n", "dennis_rayed | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
4 | \n", "chestertonii | \n", "chestertonii | \n", "NaN | \n", "NaN | \n", "NaN | \n", "