Update with master file including all image metadata

#1
.gitattributes CHANGED
@@ -53,3 +53,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
 
 
 
 
53
  *.jpg filter=lfs diff=lfs merge=lfs -text
54
  *.jpeg filter=lfs diff=lfs merge=lfs -text
55
  *.webp filter=lfs diff=lfs merge=lfs -text
56
+
57
+ Jiggins_Zenodo_Img_Master.csv filter=lfs diff=lfs merge=lfs -text
58
+
.gitignore ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ #.idea/
161
+
162
+ # Mac system
163
+ .DS_Store
164
+
Jiggins_Heliconius_Master.csv ADDED
The diff for this file is too large to render. See raw diff
 
Jiggins_Zenodo_Img_Master.csv CHANGED
The diff for this file is too large to render. See raw diff
 
Jiggins_Zenodo_dorsal_Img_Master.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2034f2b00a4849e80b7707934c67331c6761318d023799c661165c7bf2d00f50
3
+ size 5771003
README.md CHANGED
@@ -30,8 +30,8 @@ language:
30
  ### Dataset Summary
31
 
32
  Subset of the collection records from the research group of Chris Jiggins at the University of Cambridge derived from almost 20 years of field studies.
33
- This subset contains approximately 34,000 RGB images across all Heliconius. Many records include images as well as locality data.
34
- All detached wings were photographed with a DSLR camera with a 100 mm macro-lens in standardized conditions; images and full records with data are stored in the [EarthCape database](https://heliconius.ecdb.io/default.aspx) and on [Zenodo](https://doi.org/10.5281/zenodo.4289223).
35
 
36
  Both dorsal and ventral images available. Contains both whole butterfly, and 4 wings separate. Large variation in image content.
37
 
@@ -48,27 +48,36 @@ This dataset card aims to be a base template for new datasets. It has been gener
48
 
49
  ## Dataset Structure
50
 
51
- * **Jiggins_Zenodo_Img_Master.csv:** Information for the approximately 34,000 unprocessed image files included in the Jiggins Heliconius Collection.
52
  * To access the images combine columns `zenodo_link` and `Image_name`:
53
  ```
54
  zenodo_link + '/files/' + Image_name
55
  ```
56
 
 
 
 
 
 
 
 
 
 
57
  ### Data Instances
58
 
59
- Multiple species of Heliconius including erato and melpomene.
60
  Detached wings in four quadrants (generally).
61
  Some subspecies may be photographed differently, needs segmentation preprocessing.
62
 
63
  * **Type:** JPG/jpg/tif(very few)
64
  * **Size (x pixels by y pixels):** Unknown yet
65
- * **Background (color or none):** multiple (needs to be normalised)
66
  * **Fit in frame:**
67
  * **Ruler or Scale:** Some with Ruler
68
  * **Color (ColorChecker, white-balance, None):** None
69
 
70
  #### Preprocessing steps (to be done):
71
- 1. Hybrid separation - some images labeled as H.erato and H. melpomene without subspecies names are hybrids and need to be determined what subspecies they are.
72
  2. Label correction - along with step 1.
73
  3. Removal of subspecies with no mimic pairs.
74
  4. Segmentation of four wings from images so we can focus on forewings vs hindwings: [WingSeg](https://github.com/agporto/WingSeg).
@@ -77,7 +86,38 @@ Current preprocessing steps: [WingSeg](https://github.com/agporto/WingSeg) on th
77
 
78
  ### Data Fields
79
 
80
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
  ### Data Splits
83
 
@@ -91,8 +131,9 @@ Current preprocessing steps: [WingSeg](https://github.com/agporto/WingSeg) on th
91
 
92
  ### Source Data
93
 
94
- Image subset of the [collection records](https://doi.org/10.5281/zenodo.4289222) from the research group of Chris Jiggins at the University of Cambridge derived from almost 20 years of field studies.
95
 
 
96
 
97
  #### Initial Data Collection and Normalization
98
 
@@ -140,15 +181,15 @@ None
140
 
141
  ### Licensing Information
142
 
143
- [More Information Needed]
 
 
144
 
145
  ### Citation Information
146
 
147
  Christopher Lawrence, Chris Jiggins, Butterfly Genetics Group (University of Cambridge). (2023). Jiggins Heliconius Collection. Hugging Face. https://huggingface.co/datasets/imageomics/Jiggins_Heliconius_Collection.
148
 
149
- If you use this dataset, please cite the original dataset (citation below) as well as this curated subset.
150
-
151
- Gabriela Montejo-Kovacevich, Eva van der Heijden, Nicola Nadeau, & Chris Jiggins. (2020). Cambridge butterfly wing collection batch 10. Zenodo. https://doi.org/10.5281/zenodo.4289223
152
 
153
  ### Contributions
154
 
 
30
  ### Dataset Summary
31
 
32
  Subset of the collection records from the research group of Chris Jiggins at the University of Cambridge derived from almost 20 years of field studies.
33
+ This subset contains approximately 49,359 RGB images of 12,586 specimens (34,929 images of 9,546 specimens across all Heliconius). Many records include images as well as locality data.
34
+ All detached wings were photographed with a DSLR camera with a 100 mm macro-lens in standardized conditions; images and full records with data are stored in the [EarthCape database](https://heliconius.ecdb.io/default.aspx) and on [Zenodo](https://zenodo.org/communities/butterfly?q=&l=list&p=1&s=10&sort=newest) (across 32 records from the Butterfly Genetics Group).
35
 
36
  Both dorsal and ventral images available. Contains both whole butterfly, and 4 wings separate. Large variation in image content.
37
 
 
48
 
49
  ## Dataset Structure
50
 
51
+ * **Jiggins_Zenodo_Img_Master.csv:** Information for the approximately 49,0000 unprocessed image files included in the Jiggins Heliconius Collection. Image types are `jpg`, `raw` (.CR2) and `tif`. `genus`, `species`, and `subspecies` are included columns.
52
  * To access the images combine columns `zenodo_link` and `Image_name`:
53
  ```
54
  zenodo_link + '/files/' + Image_name
55
  ```
56
 
57
+ * **Jiggins_Zenodo_dorsal_Img_Master.csv:** Subset of 24,318 images from `Jiggins_Zenodo_Img_Master.csv` with a dorsal view of the butterflies (note that some have both dorsal and ventral). This subset includes 12,296 unique specimens. Accessing the images from Zenodo works the same as above, and image types are `jpg`, `raw` (.CR2) and `tif`.
58
+
59
+ * **Jiggins_Heliconius_Master.csv:** The 34,929-image subset of all Heliconius images from `Jiggins_Zenodo_Img_Master.csv`. This subset includes 9,546 unique specimens. Accessing the images from Zenodo works the same as above, and image types are `jpg`, `raw` (.CR2) and `tif`. `species` and `subspecies` columns are also included.
60
+
61
+
62
+
63
+ * Note: The notebooks that generated these files and stats are included in the `notebooks` folder.
64
+
65
+
66
  ### Data Instances
67
 
68
+ `Jiggins_Heliconius_Master.csv` contains multiple species of Heliconius (including erato and melpomene), most are labeled down to the subspecies level. The `Jiggins_Zenodo_Img_Master.csv` also contains species from other genera, with just over half labeled to the subspecies level (these are predominantly Heliconius subspecies).
69
  Detached wings in four quadrants (generally).
70
  Some subspecies may be photographed differently, needs segmentation preprocessing.
71
 
72
  * **Type:** JPG/jpg/tif(very few)
73
  * **Size (x pixels by y pixels):** Unknown yet
74
+ * **Background (color or none):** multiple (needs to be normalized)
75
  * **Fit in frame:**
76
  * **Ruler or Scale:** Some with Ruler
77
  * **Color (ColorChecker, white-balance, None):** None
78
 
79
  #### Preprocessing steps (to be done):
80
+ 1. Hybrid separation - some images labeled as _H. erato_ and _H. melpomene_ without subspecies names are hybrids and need to be determined what subspecies they are.
81
  2. Label correction - along with step 1.
82
  3. Removal of subspecies with no mimic pairs.
83
  4. Segmentation of four wings from images so we can focus on forewings vs hindwings: [WingSeg](https://github.com/agporto/WingSeg).
 
86
 
87
  ### Data Fields
88
 
89
+ CSV Columns are as follows:
90
+
91
+ - `CAMID`: Unique identifier for each specimen that was photographed. Each `CAMID` corresponds to multiple images (based on factors such as `View` and `file_type`).
92
+ - `X`: Unique identifier for each line in the master CSV.
93
+ - `Image_name`: Filename of image.
94
+ - `View`: View of the butterfly in the image: `dorsal`, `ventral`, `forewing dorsal`, `hindwing dorsal`, `forewing ventral`, `hindwing ventral`, `dorsal and ventral`.
95
+ - `zenodo_name`: Name of the CSV file with metadata used to populate this file from the associated Zenodo record.
96
+ - `zenodo_link`: URL for the Zenodo record of the image.
97
+ - `Sequence`: Mostly numeric IDs, not unique, please see the associated Zenodo record for more information on the meaning of these designations.
98
+ - `Taxonomic_Name`: Indication of the Genus, Species, and possibly, subspecies, of the specimen. For Cross Types, this is just the Genus species pair (all _Heliconius erato_ or _Heliconius melpomene_).
99
+ - `Locality`: Likely location of specimen collection, varying levels of specificity. Please see the associated Zenodo record for more information on the meaning of these designations.
100
+ - `Sample_accession`: Some type of ID, not unique, please see the associated Zenodo record for more information on the meaning of these designations.
101
+ - `Collected_by`: Abbreviations (likely for those collecting the specimen), please see the associated Zenodo record for more information on the meaning of these designations.
102
+ - `Other_ID`: Mostly numeric IDs, not unique, please see the associated Zenodo record for more information on the meaning of these designations.
103
+ - `Date`: Please see the associated Zenodo record for more information on the meaning of these designations.
104
+ - `Dataset`: Overall collection the images belong to: `Heliconiine Butterfly Collection Records from University of Cambridge` (largely, but not entirely Heliconius), `Patricio Salazar`, `Nadeau Sheffield`, `Bogota Collection (Camilo Salazar)`, `Cambridge Collection`, `Mallet`, `Merril_Gamboa`, `STRI Collection (Owen)`. Please see the associated Zenodo record for more information on the meaning of these designations.
105
+ - `Store`: Storage location for specimen (`Box ###`).
106
+ - `Brood`: Likely indicator of batch of butterflies. Please see the associated Zenodo record for more information on the meaning of these designations.
107
+ - `Death_Date`: Date of specimen death. Only noted for 318 images.
108
+ - `Cross_Type`: Laboratory cross breeding information. There is a mix of F1 (subspecies x subspecies), F2 (F1 x F1), and backcross (F1 x subspecies) hybrids. Generally, the order of the subspecies listed in the cross corresponds to the sexes of the parents (Maternal x Paternal). There are approximately 5,000 such images; on average, there are both raw and jpg images of the specimens for each view, so this covers 820 unique specimens.
109
+ - `Stage`: Life stage of the specimen. Only 15 specimens have a non-null value for this feature, and they are all labeled as `Adult`.
110
+ - `Sex`: Sex of the specimen: `Male`, `Female`, or `Unknown`.
111
+ - `Unit_Type`: Type of the specimen: `wild`, `reared`, `Mutant`, `Wild`, `e11`, or `e12`. Please see the associated Zenodo record for more information on the meaning of these designations.
112
+ - `file_type`: Image type: `jpg`, `raw` (.CR2), or `tif`.
113
+ - `record_number`: The number associated with the Zenodo record that the image came from.
114
+ - `species`: Species of the specimen. There are 246 species represented in the full collection, 37 of these are species of Heliconius.
115
+ - `subspecies`: Subspecies of the specimen (where available, mostly labeled for Heliconius). There are 155 subspecies represented in the full collection, 110 of which are Heliconius subspecies.
116
+ - `genus`: Genus of the specimen. There are 94 unique genera represented in the full collection.
117
+
118
+ **Note:**
119
+ - `Jiggins_Heliconius_Master.csv` has all but the `genus` column, since all images are Heliconius.
120
+ - `Jiggins_Zenodo_dorsal_Img_Master.csv` does not have the last four columns, but they can be added easily with the appropriate functions in `notebooks/standardize_taxa.ipynb`. This file also has a column `CAM_dupe` indicating whether the `CAMID` has multiple images within this subset.
121
 
122
  ### Data Splits
123
 
 
131
 
132
  ### Source Data
133
 
134
+ These images are a subset of the [Butterfly Genetics Group's Cambridge butterfly collection](https://zenodo.org/communities/butterfly?q=&f=subject%3ACambridge&l=list&p=1&s=10&sort=newest). This collection of butterfly images comes from the research group of Chris Jiggins at the University of Cambridge derived from almost 20 years of field studies.
135
 
136
+ Data is pulled from the Zenodo Records in [`licenses.json`](https://huggingface.co/datasets/imageomics/Jiggins_Heliconius_Collection/blob/main/licenses.json). This file also contains full citation information for all records.
137
 
138
  #### Initial Data Collection and Normalization
139
 
 
181
 
182
  ### Licensing Information
183
 
184
+ The data (images and text) are all licensed under [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/). Each image and text in this dataset is provided under the least restrictive terms allowed by its licensing requirements as provided to us (i.e, we impose no additional restrictions past those specified by this license on the original source files). Modified images are only restricted by this original license.
185
+
186
+ Images can be matched to their source record through the `zenodo_link` column in the Master CSVs to the `url` in the licenses.json file.
187
 
188
  ### Citation Information
189
 
190
  Christopher Lawrence, Chris Jiggins, Butterfly Genetics Group (University of Cambridge). (2023). Jiggins Heliconius Collection. Hugging Face. https://huggingface.co/datasets/imageomics/Jiggins_Heliconius_Collection.
191
 
192
+ If you use this dataset, please cite the original datasets (citations for all 32 Zenodo records are in licenses.json) as well as this curated subset.
 
 
193
 
194
  ### Contributions
195
 
licenses.json ADDED
@@ -0,0 +1 @@
 
 
1
+ [{"record_number": "4289223", "url": "https://zenodo.org/record/4289223", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., van der Heijden, E., Nadeau, N., & Jiggins, C. (2020 , November). Cambridge butterfly wing collection batch 10. Zenodo. https://doi.org/10.5281/zenodo.4289223", "bibtex": "@misc{gabriela_montejo_kovacevich_2020_4289223, author = {Gabriela Montejo-Kovacevich and Eva van der Heijden and Nicola Nadeau and Chris Jiggins}, title = {Cambridge butterfly wing collection batch 10}, month = nov, year = 2020, publisher = {Zenodo}, doi = {10.5281/zenodo.4289223}, url = {https://doi.org/10.5281/zenodo.4289223} }"}, {"record_number": "4288311", "url": "https://zenodo.org/record/4288311", "license": "cc-by-4.0", "citation": "Salazar, P. A., Nadeau, N., Montejo-Kovacevich, G., & Jiggins, C. (2020 , November). Sheffield butterfly wing collection - Patricio Salazar, Nicola Nadeau, Ikiam broods batch 1 and 2. Zenodo. https://doi.org/10.5281/zenodo.4288311", "bibtex": "@misc{patricio_a_salazar_2020_4288311, author = {Patricio A. Salazar and Nicola Nadeau and Gabriela Montejo-Kovacevich and Chris Jiggins}, title = {{Sheffield butterfly wing collection - Patricio Salazar, Nicola Nadeau, Ikiam broods batch 1 and 2}}, month = nov, year = 2020, publisher = {Zenodo}, doi = {10.5281/zenodo.4288311}, url = {https://doi.org/10.5281/zenodo.4288311} }"}, {"record_number": "2677821", "url": "https://zenodo.org/record/2677821", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Jiggins, C., & Warren, I. (2019 , May). Cambridge butterfly wing collection batch 2. Zenodo. https://doi.org/10.5281/zenodo.2677821", "bibtex": "@misc{montejo_kovacevich_2019_2677821, author = {Montejo-Kovacevich, Gabriela and Jiggins, Chris and Warren, Ian}, title = {Cambridge butterfly wing collection batch 2}, month = may, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2677821}, url = {https://doi.org/10.5281/zenodo.2677821} }"}, {"record_number": "3477891", "url": "https://zenodo.org/record/3477891", "license": "cc-by-4.0", "citation": "Jiggins, C., Montejo-Kovacevich, G., Salazar, P., & Warren, I. (2019 , October). Heliconiine Butterfly Collection Records from University of Cambridge. Zenodo. https://doi.org/10.5281/zenodo.3477891", "bibtex": "@misc{chris_jiggins_2019_3477891, author = {Chris Jiggins and Gabriela Montejo-Kovacevich and Patricio Salazar and Ian Warren}, title = {{Heliconiine Butterfly Collection Records from University of Cambridge}}, month = oct, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.3477891}, url = {https://doi.org/10.5281/zenodo.3477891} }"}, {"record_number": "2682458", "url": "https://zenodo.org/record/2682458", "license": "cc-by-4.0", "citation": "Jiggins, C., Montejo-Kovacevich, G., Warren, I., & Wiltshire, E. (2019 , May). Cambridge butterfly wing collection batch 3. Zenodo. https://doi.org/10.5281/zenodo.2682458", "bibtex": "@misc{jiggins_2019_2682458, author = {Jiggins, Chris and Montejo-Kovacevich, Gabriela and Warren, Ian and Wiltshire, Eva}, title = {Cambridge butterfly wing collection batch 3}, month = may, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2682458}, url = {https://doi.org/10.5281/zenodo.2682458} }"}, {"record_number": "2682669", "url": "https://zenodo.org/record/2682669", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Jiggins, C., & Warren, I. (2019 , May). Cambridge butterfly wing collection batch 4. Zenodo. https://doi.org/10.5281/zenodo.2682669", "bibtex": "@misc{montejo_kovacevich_2019_2682669, author = {Montejo-Kovacevich, Gabriela and Jiggins, Chris and Warren, Ian}, title = {Cambridge butterfly wing collection batch 4}, month = may, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2682669}, url = {https://doi.org/10.5281/zenodo.2682669} }"}, {"record_number": "2684906", "url": "https://zenodo.org/record/2684906", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Jiggins, C., Warren, I., & Wiltshire, E. (2019 , May). Cambridge butterfly wing collection batch 5. Zenodo. https://doi.org/10.5281/zenodo.2684906", "bibtex": "@misc{montejo_kovacevich_2019_2684906, author = {Montejo-Kovacevich, Gabriela and Jiggins, Chris and Warren, Ian and Wiltshire, Eva}, title = {Cambridge butterfly wing collection batch 5}, month = may, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2684906}, url = {https://doi.org/10.5281/zenodo.2684906} }"}, {"record_number": "2552371", "url": "https://zenodo.org/record/2552371", "license": "cc-by-4.0", "citation": "Warren, I. & Jiggins, C. (2019 , February). Miscellaneous Heliconius wing photographs (2001-2019) Part 1. Zenodo. https://doi.org/10.5281/zenodo.2552371", "bibtex": "@misc{warren_2019_2552371, author = {Warren, Ian and Jiggins, Chris}, title = {{Miscellaneous Heliconius wing photographs (2001-2019) Part 1}}, month = feb, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2552371}, url = {https://doi.org/10.5281/zenodo.2552371} }"}, {"record_number": "2553977", "url": "https://zenodo.org/record/2553977", "license": "cc-by-4.0", "citation": "Warren, I. & Jiggins, C. (2019 , February). Miscellaneous Heliconius wing photographs (2001-2019) Part 3. Zenodo. https://doi.org/10.5281/zenodo.2553977", "bibtex": "@misc{warren_2019_2553977, author = {Warren, Ian and Jiggins, Chris}, title = {{Miscellaneous Heliconius wing photographs (2001-2019) Part 3}}, month = feb, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2553977}, url = {https://doi.org/10.5281/zenodo.2553977} }"}, {"record_number": "2686762", "url": "https://zenodo.org/record/2686762", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Jiggins, C., Warren, I., & Wiltshire, E. (2019 , May). Cambridge butterfly wing collection batch 6. Zenodo. https://doi.org/10.5281/zenodo.2686762", "bibtex": "@misc{montejo_kovacevich_2019_2686762, author = {Montejo-Kovacevich, Gabriela and Jiggins, Chris and Warren, Ian and Wiltshire, Eva}, title = {Cambridge butterfly wing collection batch 6}, month = may, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2686762}, url = {https://doi.org/10.5281/zenodo.2686762} }"}, {"record_number": "2549524", "url": "https://zenodo.org/record/2549524", "license": "cc-by-4.0", "citation": "Jiggins, C. & Warren, I. (2019 , January). Cambridge butterfly wing collection - Chris Jiggins 2001/2 broods batch 1. Zenodo. https://doi.org/10.5281/zenodo.2549524", "bibtex": "@misc{jiggins_2019_2549524, author = {Jiggins, Chris and Warren, Ian}, title = {{Cambridge butterfly wing collection - Chris Jiggins 2001/2 broods batch 1}}, month = jan, year = 2019, publisher = {Zenodo}, version = 1, doi = {10.5281/zenodo.2549524}, url = {https://doi.org/10.5281/zenodo.2549524} }"}, {"record_number": "2550097", "url": "https://zenodo.org/record/2550097", "license": "cc-by-4.0", "citation": "Jiggins, C. & Warren, I. (2019 , January). Cambridge butterfly wing collection - Chris Jiggins 2001/2 broods batch 2. Zenodo. https://doi.org/10.5281/zenodo.2550097", "bibtex": "@misc{jiggins_2019_2550097, author = {Jiggins, Chris and Warren, Ian}, title = {{Cambridge butterfly wing collection - Chris Jiggins 2001/2 broods batch 2}}, month = jan, year = 2019, publisher = {Zenodo}, version = 1, doi = {10.5281/zenodo.2550097}, url = {https://doi.org/10.5281/zenodo.2550097} }"}, {"record_number": "4153502", "url": "https://zenodo.org/record/4153502", "license": "cc-by-4.0", "citation": "Meier, J. I., Salazar, P., Montejo-Kovacevich, G., Warren, I., & Jggins, C. (2020 , October). Cambridge butterfly wing collection - Patricio Salazar PhD wild specimens batch 3. Zenodo. https://doi.org/10.5281/zenodo.4153502", "bibtex": "@misc{joana_i_meier_2020_4153502, author = {Joana I. Meier and Patricio Salazar and Gabriela Montejo-Kovacevich and Ian Warren and Chris Jggins}, title = {{Cambridge butterfly wing collection - Patricio Salazar PhD wild specimens batch 3}}, month = oct, year = 2020, publisher = {Zenodo}, doi = {10.5281/zenodo.4153502}, url = {https://doi.org/10.5281/zenodo.4153502} }"}, {"record_number": "1247307", "url": "https://zenodo.org/record/1247307", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Jiggins, C., & Warren, I. (2018 , May). Cambridge butterfly wing collection batch 1. Zenodo. https://doi.org/10.5281/zenodo.1247307", "bibtex": "@misc{gabriela_montejo_kovacevich_2018_1247307, author = {Gabriela Montejo-Kovacevich and Chris Jiggins and Ian Warren}, title = {Cambridge butterfly wing collection batch 1}, month = may, year = 2018, publisher = {Zenodo}, doi = {10.5281/zenodo.1247307}, url = {https://doi.org/10.5281/zenodo.1247307} }"}, {"record_number": "3082688", "url": "https://zenodo.org/record/3082688", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Jiggins, C., & Warren, I. (2019 , May). Cambridge butterfly wing collection batch 1- version 2. Zenodo. https://doi.org/10.5281/zenodo.3082688", "bibtex": "@misc{montejo_kovacevich_2019_3082688, author = {Montejo-Kovacevich, Gabriela and Jiggins, Chris and Warren, Ian}, title = {{Cambridge butterfly wing collection batch 1- version 2}}, month = may, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.3082688}, url = {https://doi.org/10.5281/zenodo.3082688} }"}, {"record_number": "2813153", "url": "https://zenodo.org/record/2813153", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Jiggins, C., Warren, I., Salazar, C., Elias, M., Gavins, I., Wiltshire, E., Montgomery, S., & McMillan, O. (2019 , May). Cambridge and collaborators butterfly wing collection batch 10. Zenodo. https://doi.org/10.5281/zenodo.2813153", "bibtex": "@misc{montejo_kovacevich_2019_2813153, author = {Montejo-Kovacevich, Gabriela and Jiggins, Chris and Warren, Ian and Salazar, Camilo and Elias, Marianne and Gavins, Imogen and Wiltshire, Eva and Montgomery, Stephen and McMillan, Owen}, title = {{Cambridge and collaborators butterfly wing collection batch 10}}, month = may, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2813153}, url = {https://doi.org/10.5281/zenodo.2813153} }"}, {"record_number": "1748277", "url": "https://zenodo.org/record/1748277", "license": "cc-by-4.0", "citation": "Salazar, P., Montejo-Kovacevich, G., Warren, I., & Jiggins, C. (2018 , December). Cambridge butterfly wing collection - Patricio Salazar PhD wild and bred specimens batch 1. Zenodo. https://doi.org/10.5281/zenodo.1748277", "bibtex": "@misc{salazar_2018_1748277, author = {Salazar, Patricio and Montejo-Kovacevich, Gabriela and Warren, Ian and Jiggins, Chris}, title = {{Cambridge butterfly wing collection - Patricio Salazar PhD wild and bred specimens batch 1}}, month = dec, year = 2018, publisher = {Zenodo}, doi = {10.5281/zenodo.1748277}, url = {https://doi.org/10.5281/zenodo.1748277} }"}, {"record_number": "2702457", "url": "https://zenodo.org/record/2702457", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Jiggins, C., Warren, I., & Wiltshire, E. (2019 , May). Cambridge butterfly wing collection batch 7. Zenodo. https://doi.org/10.5281/zenodo.2702457", "bibtex": "@misc{montejo_kovacevich_2019_2702457, author = {Montejo-Kovacevich, Gabriela and Jiggins, Chris and Warren, Ian and Wiltshire, Eva}, title = {Cambridge butterfly wing collection batch 7}, month = may, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2702457}, url = {https://doi.org/10.5281/zenodo.2702457} }"}, {"record_number": "2548678", "url": "https://zenodo.org/record/2548678", "license": "cc-by-4.0", "citation": "Salazar, P., Montejo-Kovacevich, G., Warren, I., & Jiggins, C. (2019 , January). Cambridge butterfly wing collection - Patricio Salazar PhD wild and bred specimens batch 2. Zenodo. https://doi.org/10.5281/zenodo.2548678", "bibtex": "@misc{salazar_2019_2548678, author = {Salazar, Patricio and Montejo-Kovacevich, Gabriela and Warren, Ian and Jiggins, Chris}, title = {{Cambridge butterfly wing collection - Patricio Salazar PhD wild and bred specimens batch 2}}, month = jan, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2548678}, url = {https://doi.org/10.5281/zenodo.2548678} }"}, {"record_number": "5561246", "url": "https://zenodo.org/record/5561246", "license": "cc-by-4.0", "citation": "Pinheiro de Castro, E., Jiggins, C., Lucas da Silva-Brand\u00e3o, K., Victor Lucci Freitas, A., Zikan Cardoso, M., Van Der Heijden, E., Meier, J., & Warren, I. (2022 , February). Brazilian Butterflies Collected December 2020 to January 2021. Zenodo. https://doi.org/10.5281/zenodo.5561246", "bibtex": "@misc{pinheiro_de_castro_2022_5561246, author = {Pinheiro de Castro, Erika and Jiggins, Christopher and Lucas da Silva-Brand\u00e3o, Karina and Victor Lucci Freitas, Andre and Zikan Cardoso, Marcio and Van Der Heijden, Eva and Meier, Joana and Warren, Ian}, title = {{Brazilian Butterflies Collected December 2020 to January 2021}}, month = feb, year = 2022, publisher = {Zenodo}, doi = {10.5281/zenodo.5561246}, url = {https://doi.org/10.5281/zenodo.5561246} }"}, {"record_number": "2707828", "url": "https://zenodo.org/record/2707828", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Jiggins, C., Warren, I., & Wiltshire, E. (2019 , May). Cambridge butterfly wing collection batch 8. Zenodo. https://doi.org/10.5281/zenodo.2707828", "bibtex": "@misc{montejo_kovacevich_2019_2707828, author = {Montejo-Kovacevich, Gabriela and Jiggins, Chris and Warren, Ian and Wiltshire, Eva}, title = {Cambridge butterfly wing collection batch 8}, month = may, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2707828}, url = {https://doi.org/10.5281/zenodo.2707828} }"}, {"record_number": "2714333", "url": "https://zenodo.org/record/2714333", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Jiggins, C., Warren, I., Wiltshire, E., & Gavins, I. (2019 , May). Cambridge butterfly wing collection batch 9. Zenodo. https://doi.org/10.5281/zenodo.2714333", "bibtex": "@misc{montejo_kovacevich_2019_2714333, author = {Montejo-Kovacevich, Gabriela and Jiggins, Chris and Warren, Ian and Wiltshire, Eva and Gavins, Imogen}, title = {Cambridge butterfly wing collection batch 9}, month = may, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2714333}, url = {https://doi.org/10.5281/zenodo.2714333} }"}, {"record_number": "4291095", "url": "https://zenodo.org/record/4291095", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., van der Heijden, E., & Jiggins, C. (2020 , November). Cambridge butterfly collection - GMK Broods Ikiam 2018. Zenodo. https://doi.org/10.5281/zenodo.4291095", "bibtex": "@misc{gabriela_montejo_kovacevich_2020_4291095, author = {Gabriela Montejo-Kovacevich and Eva van der Heijden and Chris Jiggins}, title = {{Cambridge butterfly collection - GMK Broods Ikiam 2018}}, month = nov, year = 2020, publisher = {Zenodo}, doi = {10.5281/zenodo.4291095}, url = {https://doi.org/10.5281/zenodo.4291095} }"}, {"record_number": "5731587", "url": "https://zenodo.org/record/5731587", "license": "cc-by-4.0", "citation": "Meier, J., Barker, A., Jiggins, C., Warren, I., & Blow, R. (2021 , November). Cambridge butterfly wing collection - Ecuador, August 2019. Zenodo. https://doi.org/10.5281/zenodo.5731587", "bibtex": "@misc{joana_meier_2021_5731587, author = {Joana Meier and Annalie Barker and Chris Jiggins and Ian Warren and Rachel Blow}, title = {{Cambridge butterfly wing collection - Ecuador, August 2019}}, month = nov, year = 2021, publisher = {Zenodo}, version = {version 1}, doi = {10.5281/zenodo.5731587}, url = {https://doi.org/10.5281/zenodo.5731587} }"}, {"record_number": "3569598", "url": "https://zenodo.org/record/3569598", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Cookson, L., van der Heijden, E., Warren, I., Edwards, D. P., & Jiggins, C. (2019 , December). Cambridge butterfly collection - Loreto, Peru 2018. Zenodo. https://doi.org/10.5281/zenodo.3569598", "bibtex": "@misc{gabriela_montejo_kovacevich_2019_3569598, author = {Gabriela Montejo-Kovacevich and Letitia Cookson and Eva van der Heijden and Ian Warren and David P. Edwards and Chris Jiggins}, title = {Cambridge butterfly collection - Loreto, Peru 2018}, month = dec, year = 2019, publisher = {Zenodo}, version = {1.0.0}, doi = {10.5281/zenodo.3569598}, url = {https://doi.org/10.5281/zenodo.3569598} }"}, {"record_number": "4287444", "url": "https://zenodo.org/record/4287444", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Cookson, L., van der Heijden, E., Warren, I., Edwards, D. P., & Jiggins, C. (2020 , November). Cambridge butterfly collection - Loreto, Peru 2018 batch2. Zenodo. https://doi.org/10.5281/zenodo.4287444", "bibtex": "@misc{gabriela_montejo_kovacevich_2020_4287444, author = {Gabriela Montejo-Kovacevich and Letitia Cookson and Eva van der Heijden and Ian Warren and David P. Edwards and Chris Jiggins}, title = {{Cambridge butterfly collection - Loreto, Peru 2018 batch2}}, month = nov, year = 2020, publisher = {Zenodo}, doi = {10.5281/zenodo.4287444}, url = {https://doi.org/10.5281/zenodo.4287444} }"}, {"record_number": "4288250", "url": "https://zenodo.org/record/4288250", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Cookson, L., van der Heijden, E., Warren, I., Edwards, D. P., & Jiggins, C. (2020 , November). Cambridge butterfly collection - Loreto, Peru 2018 batch3. Zenodo. https://doi.org/10.5281/zenodo.4288250", "bibtex": "@misc{gabriela_montejo_kovacevich_2020_4288250, author = {Gabriela Montejo-Kovacevich and Letitia Cookson and Eva van der Heijden and Ian Warren and David P. Edwards and Chris Jiggins}, title = {{Cambridge butterfly collection - Loreto, Peru 2018 batch3}}, month = nov, year = 2020, publisher = {Zenodo}, doi = {10.5281/zenodo.4288250}, url = {https://doi.org/10.5281/zenodo.4288250} }"}, {"record_number": "5526257", "url": "https://zenodo.org/record/5526257", "license": "cc-by-4.0", "citation": "Montejo-Kovacevich, G., Paynter, Q., & Ghane, A. (2021 , September). Heliconius erato cyrbia, Cook Islands (New Zealand) 2016, 2019, 2021. Zenodo. https://doi.org/10.5281/zenodo.5526257", "bibtex": "@misc{montejo_kovacevich_2021_5526257, author = {Montejo-Kovacevich, Gabriela and Paynter, Quentin and Ghane, Amin}, title = {{Heliconius erato cyrbia, Cook Islands (New Zealand) 2016, 2019, 2021}}, month = sep, year = 2021, publisher = {Zenodo}, doi = {10.5281/zenodo.5526257}, url = {https://doi.org/10.5281/zenodo.5526257} }"}, {"record_number": "2553501", "url": "https://zenodo.org/record/2553501", "license": "cc-by-4.0", "citation": "Warren, I. & Jiggins, C. (2019 , February). Miscellaneous Heliconius wing photographs (2001-2019) Part 2. Zenodo. https://doi.org/10.5281/zenodo.2553501", "bibtex": "@misc{warren_2019_2553501, author = {Warren, Ian and Jiggins, Chris}, title = {{Miscellaneous Heliconius wing photographs (2001-2019) Part 2}}, month = feb, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2553501}, url = {https://doi.org/10.5281/zenodo.2553501} }"}, {"record_number": "2735056", "url": "https://zenodo.org/record/2735056", "license": "cc-by-4.0", "citation": "Salazar, C., Montejo-Kovacevich, G., Jiggins, C., Warren, I., & Gavins, I. (2019 , May). Camilo Salazar and Cambridge butterfly wing collection batch 1. Zenodo. https://doi.org/10.5281/zenodo.2735056", "bibtex": "@misc{salazar_2019_2735056, author = {Salazar, Camilo and Montejo-Kovacevich, Gabriela and Jiggins, Chris and Warren, Ian and Gavins, Imogen}, title = {{Camilo Salazar and Cambridge butterfly wing collection batch 1}}, month = may, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2735056}, url = {https://doi.org/10.5281/zenodo.2735056} }"}, {"record_number": "2554218", "url": "https://zenodo.org/record/2554218", "license": "cc-by-4.0", "citation": "Mattila, A., Jiggins, C., & Warren, I. (2019 , February). University of Helsinki butterfly wing collection - Anniina Mattila field caught specimens. Zenodo. https://doi.org/10.5281/zenodo.2554218", "bibtex": "@misc{mattila_2019_2554218, author = {Mattila, Anniina and Jiggins, Chris and Warren, Ian}, title = {{University of Helsinki butterfly wing collection - Anniina Mattila field caught specimens}}, month = feb, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2554218}, url = {https://doi.org/10.5281/zenodo.2554218} }"}, {"record_number": "2555086", "url": "https://zenodo.org/record/2555086", "license": "cc-by-4.0", "citation": "Mattila, A., Jiggins, C., & Warren, I. (2019 , February). University of Helsinki butterfly collection - Anniina Mattila bred specimens. Zenodo. https://doi.org/10.5281/zenodo.2555086", "bibtex": "@misc{mattila_2019_2555086, author = {Mattila, Anniina and Jiggins, Chris and Warren, Ian}, title = {{University of Helsinki butterfly collection - Anniina Mattila bred specimens}}, month = feb, year = 2019, publisher = {Zenodo}, doi = {10.5281/zenodo.2555086}, url = {https://doi.org/10.5281/zenodo.2555086} }"}]
notebooks/make_Jiggins_Img_Master.ipynb ADDED
@@ -0,0 +1,2494 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "import pandas as pd"
10
+ ]
11
+ },
12
+ {
13
+ "cell_type": "code",
14
+ "execution_count": 2,
15
+ "metadata": {},
16
+ "outputs": [],
17
+ "source": [
18
+ "jiggins = pd.read_csv(\"../Jiggins_Zenodo_Master.csv\", low_memory = False)"
19
+ ]
20
+ },
21
+ {
22
+ "cell_type": "code",
23
+ "execution_count": 3,
24
+ "metadata": {},
25
+ "outputs": [
26
+ {
27
+ "data": {
28
+ "text/plain": [
29
+ "(49956, 25)"
30
+ ]
31
+ },
32
+ "execution_count": 3,
33
+ "metadata": {},
34
+ "output_type": "execute_result"
35
+ }
36
+ ],
37
+ "source": [
38
+ "jiggins.shape"
39
+ ]
40
+ },
41
+ {
42
+ "cell_type": "code",
43
+ "execution_count": 4,
44
+ "metadata": {},
45
+ "outputs": [
46
+ {
47
+ "data": {
48
+ "text/html": [
49
+ "<div>\n",
50
+ "<style scoped>\n",
51
+ " .dataframe tbody tr th:only-of-type {\n",
52
+ " vertical-align: middle;\n",
53
+ " }\n",
54
+ "\n",
55
+ " .dataframe tbody tr th {\n",
56
+ " vertical-align: top;\n",
57
+ " }\n",
58
+ "\n",
59
+ " .dataframe thead th {\n",
60
+ " text-align: right;\n",
61
+ " }\n",
62
+ "</style>\n",
63
+ "<table border=\"1\" class=\"dataframe\">\n",
64
+ " <thead>\n",
65
+ " <tr style=\"text-align: right;\">\n",
66
+ " <th></th>\n",
67
+ " <th>Unnamed: 0</th>\n",
68
+ " <th>CAMID</th>\n",
69
+ " <th>X</th>\n",
70
+ " <th>Image_name</th>\n",
71
+ " <th>Side</th>\n",
72
+ " <th>zenodo_name</th>\n",
73
+ " <th>zenodo_link</th>\n",
74
+ " <th>Sequence</th>\n",
75
+ " <th>Taxonomic.Name</th>\n",
76
+ " <th>Locality</th>\n",
77
+ " <th>...</th>\n",
78
+ " <th>Dataset</th>\n",
79
+ " <th>Store</th>\n",
80
+ " <th>Eclosion.Date</th>\n",
81
+ " <th>Brood</th>\n",
82
+ " <th>Death.Date</th>\n",
83
+ " <th>Cross.Type</th>\n",
84
+ " <th>Stage</th>\n",
85
+ " <th>Sex</th>\n",
86
+ " <th>Unit.Type</th>\n",
87
+ " <th>Verbatim.Coordinates</th>\n",
88
+ " </tr>\n",
89
+ " </thead>\n",
90
+ " <tbody>\n",
91
+ " <tr>\n",
92
+ " <th>0</th>\n",
93
+ " <td>1</td>\n",
94
+ " <td>NaN</td>\n",
95
+ " <td>20776</td>\n",
96
+ " <td>NaN</td>\n",
97
+ " <td>NaN</td>\n",
98
+ " <td>0.sheffield.ps.nn.ikiam.batch1.csv</td>\n",
99
+ " <td>https://zenodo.org/record/4288311</td>\n",
100
+ " <td>NaN</td>\n",
101
+ " <td>NaN</td>\n",
102
+ " <td>NaN</td>\n",
103
+ " <td>...</td>\n",
104
+ " <td>NaN</td>\n",
105
+ " <td>NaN</td>\n",
106
+ " <td>NaN</td>\n",
107
+ " <td>NaN</td>\n",
108
+ " <td>NaN</td>\n",
109
+ " <td>NaN</td>\n",
110
+ " <td>NaN</td>\n",
111
+ " <td>NaN</td>\n",
112
+ " <td>NaN</td>\n",
113
+ " <td>NaN</td>\n",
114
+ " </tr>\n",
115
+ " <tr>\n",
116
+ " <th>1</th>\n",
117
+ " <td>2</td>\n",
118
+ " <td>NaN</td>\n",
119
+ " <td>20777</td>\n",
120
+ " <td>NaN</td>\n",
121
+ " <td>NaN</td>\n",
122
+ " <td>0.sheffield.ps.nn.ikiam.batch1.csv</td>\n",
123
+ " <td>https://zenodo.org/record/4288311</td>\n",
124
+ " <td>NaN</td>\n",
125
+ " <td>NaN</td>\n",
126
+ " <td>NaN</td>\n",
127
+ " <td>...</td>\n",
128
+ " <td>NaN</td>\n",
129
+ " <td>NaN</td>\n",
130
+ " <td>NaN</td>\n",
131
+ " <td>NaN</td>\n",
132
+ " <td>NaN</td>\n",
133
+ " <td>NaN</td>\n",
134
+ " <td>NaN</td>\n",
135
+ " <td>NaN</td>\n",
136
+ " <td>NaN</td>\n",
137
+ " <td>NaN</td>\n",
138
+ " </tr>\n",
139
+ " <tr>\n",
140
+ " <th>2</th>\n",
141
+ " <td>3</td>\n",
142
+ " <td>NaN</td>\n",
143
+ " <td>20778</td>\n",
144
+ " <td>NaN</td>\n",
145
+ " <td>NaN</td>\n",
146
+ " <td>0.sheffield.ps.nn.ikiam.batch1.csv</td>\n",
147
+ " <td>https://zenodo.org/record/4288311</td>\n",
148
+ " <td>NaN</td>\n",
149
+ " <td>NaN</td>\n",
150
+ " <td>NaN</td>\n",
151
+ " <td>...</td>\n",
152
+ " <td>NaN</td>\n",
153
+ " <td>NaN</td>\n",
154
+ " <td>NaN</td>\n",
155
+ " <td>NaN</td>\n",
156
+ " <td>NaN</td>\n",
157
+ " <td>NaN</td>\n",
158
+ " <td>NaN</td>\n",
159
+ " <td>NaN</td>\n",
160
+ " <td>NaN</td>\n",
161
+ " <td>NaN</td>\n",
162
+ " </tr>\n",
163
+ " <tr>\n",
164
+ " <th>3</th>\n",
165
+ " <td>4</td>\n",
166
+ " <td>NaN</td>\n",
167
+ " <td>20779</td>\n",
168
+ " <td>NaN</td>\n",
169
+ " <td>NaN</td>\n",
170
+ " <td>0.sheffield.ps.nn.ikiam.batch1.csv</td>\n",
171
+ " <td>https://zenodo.org/record/4288311</td>\n",
172
+ " <td>NaN</td>\n",
173
+ " <td>NaN</td>\n",
174
+ " <td>NaN</td>\n",
175
+ " <td>...</td>\n",
176
+ " <td>NaN</td>\n",
177
+ " <td>NaN</td>\n",
178
+ " <td>NaN</td>\n",
179
+ " <td>NaN</td>\n",
180
+ " <td>NaN</td>\n",
181
+ " <td>NaN</td>\n",
182
+ " <td>NaN</td>\n",
183
+ " <td>NaN</td>\n",
184
+ " <td>NaN</td>\n",
185
+ " <td>NaN</td>\n",
186
+ " </tr>\n",
187
+ " <tr>\n",
188
+ " <th>4</th>\n",
189
+ " <td>5</td>\n",
190
+ " <td>NaN</td>\n",
191
+ " <td>20780</td>\n",
192
+ " <td>NaN</td>\n",
193
+ " <td>NaN</td>\n",
194
+ " <td>0.sheffield.ps.nn.ikiam.batch1.csv</td>\n",
195
+ " <td>https://zenodo.org/record/4288311</td>\n",
196
+ " <td>NaN</td>\n",
197
+ " <td>NaN</td>\n",
198
+ " <td>NaN</td>\n",
199
+ " <td>...</td>\n",
200
+ " <td>NaN</td>\n",
201
+ " <td>NaN</td>\n",
202
+ " <td>NaN</td>\n",
203
+ " <td>NaN</td>\n",
204
+ " <td>NaN</td>\n",
205
+ " <td>NaN</td>\n",
206
+ " <td>NaN</td>\n",
207
+ " <td>NaN</td>\n",
208
+ " <td>NaN</td>\n",
209
+ " <td>NaN</td>\n",
210
+ " </tr>\n",
211
+ " </tbody>\n",
212
+ "</table>\n",
213
+ "<p>5 rows × 25 columns</p>\n",
214
+ "</div>"
215
+ ],
216
+ "text/plain": [
217
+ " Unnamed: 0 CAMID X Image_name Side \\\n",
218
+ "0 1 NaN 20776 NaN NaN \n",
219
+ "1 2 NaN 20777 NaN NaN \n",
220
+ "2 3 NaN 20778 NaN NaN \n",
221
+ "3 4 NaN 20779 NaN NaN \n",
222
+ "4 5 NaN 20780 NaN NaN \n",
223
+ "\n",
224
+ " zenodo_name zenodo_link \\\n",
225
+ "0 0.sheffield.ps.nn.ikiam.batch1.csv https://zenodo.org/record/4288311 \n",
226
+ "1 0.sheffield.ps.nn.ikiam.batch1.csv https://zenodo.org/record/4288311 \n",
227
+ "2 0.sheffield.ps.nn.ikiam.batch1.csv https://zenodo.org/record/4288311 \n",
228
+ "3 0.sheffield.ps.nn.ikiam.batch1.csv https://zenodo.org/record/4288311 \n",
229
+ "4 0.sheffield.ps.nn.ikiam.batch1.csv https://zenodo.org/record/4288311 \n",
230
+ "\n",
231
+ " Sequence Taxonomic.Name Locality ... Dataset Store Eclosion.Date Brood \\\n",
232
+ "0 NaN NaN NaN ... NaN NaN NaN NaN \n",
233
+ "1 NaN NaN NaN ... NaN NaN NaN NaN \n",
234
+ "2 NaN NaN NaN ... NaN NaN NaN NaN \n",
235
+ "3 NaN NaN NaN ... NaN NaN NaN NaN \n",
236
+ "4 NaN NaN NaN ... NaN NaN NaN NaN \n",
237
+ "\n",
238
+ " Death.Date Cross.Type Stage Sex Unit.Type Verbatim.Coordinates \n",
239
+ "0 NaN NaN NaN NaN NaN NaN \n",
240
+ "1 NaN NaN NaN NaN NaN NaN \n",
241
+ "2 NaN NaN NaN NaN NaN NaN \n",
242
+ "3 NaN NaN NaN NaN NaN NaN \n",
243
+ "4 NaN NaN NaN NaN NaN NaN \n",
244
+ "\n",
245
+ "[5 rows x 25 columns]"
246
+ ]
247
+ },
248
+ "execution_count": 4,
249
+ "metadata": {},
250
+ "output_type": "execute_result"
251
+ }
252
+ ],
253
+ "source": [
254
+ "jiggins.head()"
255
+ ]
256
+ },
257
+ {
258
+ "cell_type": "code",
259
+ "execution_count": 5,
260
+ "metadata": {},
261
+ "outputs": [
262
+ {
263
+ "data": {
264
+ "text/plain": [
265
+ "Index(['Unnamed: 0', 'CAMID', 'X', 'Image_name', 'Side', 'zenodo_name',\n",
266
+ " 'zenodo_link', 'Sequence', 'Taxonomic.Name', 'Locality',\n",
267
+ " 'Sample.accession', 'Collected.by', 'Other.Id', 'Collected.By', 'Date',\n",
268
+ " 'Dataset', 'Store', 'Eclosion.Date', 'Brood', 'Death.Date',\n",
269
+ " 'Cross.Type', 'Stage', 'Sex', 'Unit.Type', 'Verbatim.Coordinates'],\n",
270
+ " dtype='object')"
271
+ ]
272
+ },
273
+ "execution_count": 5,
274
+ "metadata": {},
275
+ "output_type": "execute_result"
276
+ }
277
+ ],
278
+ "source": [
279
+ "jiggins.columns"
280
+ ]
281
+ },
282
+ {
283
+ "cell_type": "code",
284
+ "execution_count": 6,
285
+ "metadata": {},
286
+ "outputs": [
287
+ {
288
+ "data": {
289
+ "text/plain": [
290
+ "411"
291
+ ]
292
+ },
293
+ "execution_count": 6,
294
+ "metadata": {},
295
+ "output_type": "execute_result"
296
+ }
297
+ ],
298
+ "source": [
299
+ "jiggins.Image_name.isna().sum()"
300
+ ]
301
+ },
302
+ {
303
+ "cell_type": "code",
304
+ "execution_count": 7,
305
+ "metadata": {},
306
+ "outputs": [
307
+ {
308
+ "data": {
309
+ "text/plain": [
310
+ "28585 CAM036108_v.JPG\n",
311
+ "45469 CAM044420_v.CR2\n",
312
+ "16097 CAM011543_v.CR2\n",
313
+ "22992 CAM017525_v.JPG\n",
314
+ "6601 CAM000930_v.JPG\n",
315
+ "39261 CAM043354_v.CR2\n",
316
+ "2577 19N2059_d.CR2\n",
317
+ "21344 CAM017153_d.JPG\n",
318
+ "48669 CS004036_d.JPG\n",
319
+ "19706 CAM016699_v.JPG\n",
320
+ "12020 CAM009527_v.JPG\n",
321
+ "47898 CS000628_d.JPG\n",
322
+ "7592 CAM001394_d.JPG\n",
323
+ "43523 CAM044173_v.CR2\n",
324
+ "12596 CAM010226_v.JPG\n",
325
+ "33816 CAM041028_v.JPG\n",
326
+ "23148 CAM017547_v_whitestandard.JPG\n",
327
+ "44996 CAM044362_hwv.CR2\n",
328
+ "3460 19N2605_v.JPG\n",
329
+ "24164 CAM017738_d_whitestandard.CR2\n",
330
+ "Name: Image_name, dtype: object"
331
+ ]
332
+ },
333
+ "execution_count": 7,
334
+ "metadata": {},
335
+ "output_type": "execute_result"
336
+ }
337
+ ],
338
+ "source": [
339
+ "jiggins.Image_name.sample(20)"
340
+ ]
341
+ },
342
+ {
343
+ "cell_type": "code",
344
+ "execution_count": 8,
345
+ "metadata": {},
346
+ "outputs": [
347
+ {
348
+ "data": {
349
+ "text/html": [
350
+ "<div>\n",
351
+ "<style scoped>\n",
352
+ " .dataframe tbody tr th:only-of-type {\n",
353
+ " vertical-align: middle;\n",
354
+ " }\n",
355
+ "\n",
356
+ " .dataframe tbody tr th {\n",
357
+ " vertical-align: top;\n",
358
+ " }\n",
359
+ "\n",
360
+ " .dataframe thead th {\n",
361
+ " text-align: right;\n",
362
+ " }\n",
363
+ "</style>\n",
364
+ "<table border=\"1\" class=\"dataframe\">\n",
365
+ " <thead>\n",
366
+ " <tr style=\"text-align: right;\">\n",
367
+ " <th></th>\n",
368
+ " <th>CAMID</th>\n",
369
+ " <th>X</th>\n",
370
+ " <th>Image_name</th>\n",
371
+ " <th>zenodo_name</th>\n",
372
+ " <th>zenodo_link</th>\n",
373
+ " </tr>\n",
374
+ " </thead>\n",
375
+ " <tbody>\n",
376
+ " <tr>\n",
377
+ " <th>22895</th>\n",
378
+ " <td>CAM017512</td>\n",
379
+ " <td>5226</td>\n",
380
+ " <td>CAM017512_d.JPG</td>\n",
381
+ " <td>CAM.coll.images.batch1_v2.csv</td>\n",
382
+ " <td>https://zenodo.org/record/3082688</td>\n",
383
+ " </tr>\n",
384
+ " <tr>\n",
385
+ " <th>36246</th>\n",
386
+ " <td>CAM041681</td>\n",
387
+ " <td>39690</td>\n",
388
+ " <td>CAM041681_d.CR2</td>\n",
389
+ " <td>0.gmk.broods.all.csv</td>\n",
390
+ " <td>https://zenodo.org/record/4291095</td>\n",
391
+ " </tr>\n",
392
+ " <tr>\n",
393
+ " <th>38630</th>\n",
394
+ " <td>CAM043178</td>\n",
395
+ " <td>29793</td>\n",
396
+ " <td>CAM043178_fwv.CR2</td>\n",
397
+ " <td>batch1.Peru.image.names.Zenodo.csv</td>\n",
398
+ " <td>https://zenodo.org/record/3569598</td>\n",
399
+ " </tr>\n",
400
+ " <tr>\n",
401
+ " <th>45984</th>\n",
402
+ " <td>CAM044484</td>\n",
403
+ " <td>34635</td>\n",
404
+ " <td>CAM044484_hwd.CR2</td>\n",
405
+ " <td>batch2.Peru.image.names.Zenodo.csv</td>\n",
406
+ " <td>https://zenodo.org/record/4287444</td>\n",
407
+ " </tr>\n",
408
+ " <tr>\n",
409
+ " <th>15393</th>\n",
410
+ " <td>CAM011382</td>\n",
411
+ " <td>28038</td>\n",
412
+ " <td>CAM011382_d.JPG</td>\n",
413
+ " <td>2001_2.broods.batch.2.csv</td>\n",
414
+ " <td>https://zenodo.org/record/2550097</td>\n",
415
+ " </tr>\n",
416
+ " <tr>\n",
417
+ " <th>44443</th>\n",
418
+ " <td>CAM044299</td>\n",
419
+ " <td>33864</td>\n",
420
+ " <td>CAM044299_d.JPG</td>\n",
421
+ " <td>batch2.Peru.image.names.Zenodo.csv</td>\n",
422
+ " <td>https://zenodo.org/record/4287444</td>\n",
423
+ " </tr>\n",
424
+ " <tr>\n",
425
+ " <th>7117</th>\n",
426
+ " <td>CAM001175</td>\n",
427
+ " <td>7908</td>\n",
428
+ " <td>CAM001175_d.JPG</td>\n",
429
+ " <td>CAM.coll.images.batch4.csv</td>\n",
430
+ " <td>https://zenodo.org/record/2682669</td>\n",
431
+ " </tr>\n",
432
+ " </tbody>\n",
433
+ "</table>\n",
434
+ "</div>"
435
+ ],
436
+ "text/plain": [
437
+ " CAMID X Image_name \\\n",
438
+ "22895 CAM017512 5226 CAM017512_d.JPG \n",
439
+ "36246 CAM041681 39690 CAM041681_d.CR2 \n",
440
+ "38630 CAM043178 29793 CAM043178_fwv.CR2 \n",
441
+ "45984 CAM044484 34635 CAM044484_hwd.CR2 \n",
442
+ "15393 CAM011382 28038 CAM011382_d.JPG \n",
443
+ "44443 CAM044299 33864 CAM044299_d.JPG \n",
444
+ "7117 CAM001175 7908 CAM001175_d.JPG \n",
445
+ "\n",
446
+ " zenodo_name zenodo_link \n",
447
+ "22895 CAM.coll.images.batch1_v2.csv https://zenodo.org/record/3082688 \n",
448
+ "36246 0.gmk.broods.all.csv https://zenodo.org/record/4291095 \n",
449
+ "38630 batch1.Peru.image.names.Zenodo.csv https://zenodo.org/record/3569598 \n",
450
+ "45984 batch2.Peru.image.names.Zenodo.csv https://zenodo.org/record/4287444 \n",
451
+ "15393 2001_2.broods.batch.2.csv https://zenodo.org/record/2550097 \n",
452
+ "44443 batch2.Peru.image.names.Zenodo.csv https://zenodo.org/record/4287444 \n",
453
+ "7117 CAM.coll.images.batch4.csv https://zenodo.org/record/2682669 "
454
+ ]
455
+ },
456
+ "execution_count": 8,
457
+ "metadata": {},
458
+ "output_type": "execute_result"
459
+ }
460
+ ],
461
+ "source": [
462
+ "jiggins_imgs = jiggins[['CAMID', 'X', 'Image_name', 'zenodo_name', 'zenodo_link']].dropna()\n",
463
+ "jiggins_imgs.sample(7)"
464
+ ]
465
+ },
466
+ {
467
+ "cell_type": "code",
468
+ "execution_count": 9,
469
+ "metadata": {},
470
+ "outputs": [
471
+ {
472
+ "data": {
473
+ "text/html": [
474
+ "<div>\n",
475
+ "<style scoped>\n",
476
+ " .dataframe tbody tr th:only-of-type {\n",
477
+ " vertical-align: middle;\n",
478
+ " }\n",
479
+ "\n",
480
+ " .dataframe tbody tr th {\n",
481
+ " vertical-align: top;\n",
482
+ " }\n",
483
+ "\n",
484
+ " .dataframe thead th {\n",
485
+ " text-align: right;\n",
486
+ " }\n",
487
+ "</style>\n",
488
+ "<table border=\"1\" class=\"dataframe\">\n",
489
+ " <thead>\n",
490
+ " <tr style=\"text-align: right;\">\n",
491
+ " <th></th>\n",
492
+ " <th>CAMID</th>\n",
493
+ " <th>X</th>\n",
494
+ " <th>Image_name</th>\n",
495
+ " <th>zenodo_name</th>\n",
496
+ " <th>zenodo_link</th>\n",
497
+ " </tr>\n",
498
+ " </thead>\n",
499
+ " <tbody>\n",
500
+ " <tr>\n",
501
+ " <th>10528</th>\n",
502
+ " <td>CAM008821</td>\n",
503
+ " <td>9887</td>\n",
504
+ " <td>CAM008821_d.JPG</td>\n",
505
+ " <td>CAM.coll.images.batch6.csv</td>\n",
506
+ " <td>https://zenodo.org/record/2686762</td>\n",
507
+ " </tr>\n",
508
+ " <tr>\n",
509
+ " <th>19587</th>\n",
510
+ " <td>CAM016660</td>\n",
511
+ " <td>3856</td>\n",
512
+ " <td>CAM016660_v.JPG</td>\n",
513
+ " <td>CAM.coll.images.batch1_v2.csv</td>\n",
514
+ " <td>https://zenodo.org/record/3082688</td>\n",
515
+ " </tr>\n",
516
+ " <tr>\n",
517
+ " <th>25858</th>\n",
518
+ " <td>CAM017989</td>\n",
519
+ " <td>17211</td>\n",
520
+ " <td>CAM017989_v_whitestandard.JPG</td>\n",
521
+ " <td>CAM.coll.patricio.batch1.csv</td>\n",
522
+ " <td>https://zenodo.org/record/1748277</td>\n",
523
+ " </tr>\n",
524
+ " <tr>\n",
525
+ " <th>10042</th>\n",
526
+ " <td>CAM008668</td>\n",
527
+ " <td>46436</td>\n",
528
+ " <td>CAM008668_d.JPG</td>\n",
529
+ " <td>occurences_and_multimedia.csv</td>\n",
530
+ " <td>https://zenodo.org/record/3477891</td>\n",
531
+ " </tr>\n",
532
+ " <tr>\n",
533
+ " <th>30646</th>\n",
534
+ " <td>CAM040217</td>\n",
535
+ " <td>47915</td>\n",
536
+ " <td>CAM040217_v.JPG</td>\n",
537
+ " <td>occurences_and_multimedia.csv</td>\n",
538
+ " <td>https://zenodo.org/record/3477891</td>\n",
539
+ " </tr>\n",
540
+ " <tr>\n",
541
+ " <th>42889</th>\n",
542
+ " <td>CAM044091</td>\n",
543
+ " <td>33084</td>\n",
544
+ " <td>CAM044091_fwd.JPG</td>\n",
545
+ " <td>batch2.Peru.image.names.Zenodo.csv</td>\n",
546
+ " <td>https://zenodo.org/record/4287444</td>\n",
547
+ " </tr>\n",
548
+ " <tr>\n",
549
+ " <th>39215</th>\n",
550
+ " <td>CAM043344</td>\n",
551
+ " <td>30372</td>\n",
552
+ " <td>CAM043344_fwd.JPG</td>\n",
553
+ " <td>batch1.Peru.image.names.Zenodo.csv</td>\n",
554
+ " <td>https://zenodo.org/record/3569598</td>\n",
555
+ " </tr>\n",
556
+ " </tbody>\n",
557
+ "</table>\n",
558
+ "</div>"
559
+ ],
560
+ "text/plain": [
561
+ " CAMID X Image_name \\\n",
562
+ "10528 CAM008821 9887 CAM008821_d.JPG \n",
563
+ "19587 CAM016660 3856 CAM016660_v.JPG \n",
564
+ "25858 CAM017989 17211 CAM017989_v_whitestandard.JPG \n",
565
+ "10042 CAM008668 46436 CAM008668_d.JPG \n",
566
+ "30646 CAM040217 47915 CAM040217_v.JPG \n",
567
+ "42889 CAM044091 33084 CAM044091_fwd.JPG \n",
568
+ "39215 CAM043344 30372 CAM043344_fwd.JPG \n",
569
+ "\n",
570
+ " zenodo_name zenodo_link \n",
571
+ "10528 CAM.coll.images.batch6.csv https://zenodo.org/record/2686762 \n",
572
+ "19587 CAM.coll.images.batch1_v2.csv https://zenodo.org/record/3082688 \n",
573
+ "25858 CAM.coll.patricio.batch1.csv https://zenodo.org/record/1748277 \n",
574
+ "10042 occurences_and_multimedia.csv https://zenodo.org/record/3477891 \n",
575
+ "30646 occurences_and_multimedia.csv https://zenodo.org/record/3477891 \n",
576
+ "42889 batch2.Peru.image.names.Zenodo.csv https://zenodo.org/record/4287444 \n",
577
+ "39215 batch1.Peru.image.names.Zenodo.csv https://zenodo.org/record/3569598 "
578
+ ]
579
+ },
580
+ "execution_count": 9,
581
+ "metadata": {},
582
+ "output_type": "execute_result"
583
+ }
584
+ ],
585
+ "source": [
586
+ "jiggins_imgs[jiggins_imgs.Image_name.str.contains('JPG')].sample(7)"
587
+ ]
588
+ },
589
+ {
590
+ "cell_type": "code",
591
+ "execution_count": 10,
592
+ "metadata": {},
593
+ "outputs": [
594
+ {
595
+ "data": {
596
+ "text/html": [
597
+ "<div>\n",
598
+ "<style scoped>\n",
599
+ " .dataframe tbody tr th:only-of-type {\n",
600
+ " vertical-align: middle;\n",
601
+ " }\n",
602
+ "\n",
603
+ " .dataframe tbody tr th {\n",
604
+ " vertical-align: top;\n",
605
+ " }\n",
606
+ "\n",
607
+ " .dataframe thead th {\n",
608
+ " text-align: right;\n",
609
+ " }\n",
610
+ "</style>\n",
611
+ "<table border=\"1\" class=\"dataframe\">\n",
612
+ " <thead>\n",
613
+ " <tr style=\"text-align: right;\">\n",
614
+ " <th></th>\n",
615
+ " <th>CAMID</th>\n",
616
+ " <th>X</th>\n",
617
+ " <th>Image_name</th>\n",
618
+ " <th>zenodo_name</th>\n",
619
+ " <th>zenodo_link</th>\n",
620
+ " </tr>\n",
621
+ " </thead>\n",
622
+ " <tbody>\n",
623
+ " <tr>\n",
624
+ " <th>8296</th>\n",
625
+ " <td>CAM008147</td>\n",
626
+ " <td>44302</td>\n",
627
+ " <td>8147v.jpg</td>\n",
628
+ " <td>occurences_and_multimedia.csv</td>\n",
629
+ " <td>https://zenodo.org/record/3477891</td>\n",
630
+ " </tr>\n",
631
+ " <tr>\n",
632
+ " <th>15626</th>\n",
633
+ " <td>CAM011437</td>\n",
634
+ " <td>44275</td>\n",
635
+ " <td>11437v.jpg</td>\n",
636
+ " <td>occurences_and_multimedia.csv</td>\n",
637
+ " <td>https://zenodo.org/record/3477891</td>\n",
638
+ " </tr>\n",
639
+ " <tr>\n",
640
+ " <th>16975</th>\n",
641
+ " <td>CAM012169</td>\n",
642
+ " <td>25057</td>\n",
643
+ " <td>12169v.jpg</td>\n",
644
+ " <td>Heliconius_wing_old_photos_2001_2019_part1.csv</td>\n",
645
+ " <td>https://zenodo.org/record/2552371</td>\n",
646
+ " </tr>\n",
647
+ " <tr>\n",
648
+ " <th>14097</th>\n",
649
+ " <td>CAM010773</td>\n",
650
+ " <td>23942</td>\n",
651
+ " <td>10773v.jpg</td>\n",
652
+ " <td>Heliconius_wing_old_photos_2001_2019_part1.csv</td>\n",
653
+ " <td>https://zenodo.org/record/2552371</td>\n",
654
+ " </tr>\n",
655
+ " <tr>\n",
656
+ " <th>15970</th>\n",
657
+ " <td>CAM011513</td>\n",
658
+ " <td>24565</td>\n",
659
+ " <td>11513v.jpg</td>\n",
660
+ " <td>Heliconius_wing_old_photos_2001_2019_part1.csv</td>\n",
661
+ " <td>https://zenodo.org/record/2552371</td>\n",
662
+ " </tr>\n",
663
+ " <tr>\n",
664
+ " <th>13349</th>\n",
665
+ " <td>CAM010485</td>\n",
666
+ " <td>23640</td>\n",
667
+ " <td>10485d.jpg</td>\n",
668
+ " <td>Heliconius_wing_old_photos_2001_2019_part1.csv</td>\n",
669
+ " <td>https://zenodo.org/record/2552371</td>\n",
670
+ " </tr>\n",
671
+ " <tr>\n",
672
+ " <th>16919</th>\n",
673
+ " <td>CAM012124</td>\n",
674
+ " <td>25001</td>\n",
675
+ " <td>12124v.jpg</td>\n",
676
+ " <td>Heliconius_wing_old_photos_2001_2019_part1.csv</td>\n",
677
+ " <td>https://zenodo.org/record/2552371</td>\n",
678
+ " </tr>\n",
679
+ " </tbody>\n",
680
+ "</table>\n",
681
+ "</div>"
682
+ ],
683
+ "text/plain": [
684
+ " CAMID X Image_name \\\n",
685
+ "8296 CAM008147 44302 8147v.jpg \n",
686
+ "15626 CAM011437 44275 11437v.jpg \n",
687
+ "16975 CAM012169 25057 12169v.jpg \n",
688
+ "14097 CAM010773 23942 10773v.jpg \n",
689
+ "15970 CAM011513 24565 11513v.jpg \n",
690
+ "13349 CAM010485 23640 10485d.jpg \n",
691
+ "16919 CAM012124 25001 12124v.jpg \n",
692
+ "\n",
693
+ " zenodo_name \\\n",
694
+ "8296 occurences_and_multimedia.csv \n",
695
+ "15626 occurences_and_multimedia.csv \n",
696
+ "16975 Heliconius_wing_old_photos_2001_2019_part1.csv \n",
697
+ "14097 Heliconius_wing_old_photos_2001_2019_part1.csv \n",
698
+ "15970 Heliconius_wing_old_photos_2001_2019_part1.csv \n",
699
+ "13349 Heliconius_wing_old_photos_2001_2019_part1.csv \n",
700
+ "16919 Heliconius_wing_old_photos_2001_2019_part1.csv \n",
701
+ "\n",
702
+ " zenodo_link \n",
703
+ "8296 https://zenodo.org/record/3477891 \n",
704
+ "15626 https://zenodo.org/record/3477891 \n",
705
+ "16975 https://zenodo.org/record/2552371 \n",
706
+ "14097 https://zenodo.org/record/2552371 \n",
707
+ "15970 https://zenodo.org/record/2552371 \n",
708
+ "13349 https://zenodo.org/record/2552371 \n",
709
+ "16919 https://zenodo.org/record/2552371 "
710
+ ]
711
+ },
712
+ "execution_count": 10,
713
+ "metadata": {},
714
+ "output_type": "execute_result"
715
+ }
716
+ ],
717
+ "source": [
718
+ "jiggins_imgs[jiggins_imgs.Image_name.str.contains('jpg')].sample(7)"
719
+ ]
720
+ },
721
+ {
722
+ "cell_type": "code",
723
+ "execution_count": 11,
724
+ "metadata": {},
725
+ "outputs": [
726
+ {
727
+ "data": {
728
+ "text/html": [
729
+ "<div>\n",
730
+ "<style scoped>\n",
731
+ " .dataframe tbody tr th:only-of-type {\n",
732
+ " vertical-align: middle;\n",
733
+ " }\n",
734
+ "\n",
735
+ " .dataframe tbody tr th {\n",
736
+ " vertical-align: top;\n",
737
+ " }\n",
738
+ "\n",
739
+ " .dataframe thead th {\n",
740
+ " text-align: right;\n",
741
+ " }\n",
742
+ "</style>\n",
743
+ "<table border=\"1\" class=\"dataframe\">\n",
744
+ " <thead>\n",
745
+ " <tr style=\"text-align: right;\">\n",
746
+ " <th></th>\n",
747
+ " <th>CAMID</th>\n",
748
+ " <th>X</th>\n",
749
+ " <th>Image_name</th>\n",
750
+ " <th>zenodo_name</th>\n",
751
+ " <th>zenodo_link</th>\n",
752
+ " </tr>\n",
753
+ " </thead>\n",
754
+ " <tbody>\n",
755
+ " <tr>\n",
756
+ " <th>47693</th>\n",
757
+ " <td>CAM050052</td>\n",
758
+ " <td>26152</td>\n",
759
+ " <td>CAM050052_M1_10_Hmr_mut_D_cut.tif</td>\n",
760
+ " <td>Heliconius_wing_old_photos_2001_2019_part3.csv</td>\n",
761
+ " <td>https://zenodo.org/record/2553977</td>\n",
762
+ " </tr>\n",
763
+ " <tr>\n",
764
+ " <th>47694</th>\n",
765
+ " <td>CAM050063</td>\n",
766
+ " <td>26155</td>\n",
767
+ " <td>CAM050063_M7_17_Hmr_mut_V_IMG_8293_wb_cut.tif</td>\n",
768
+ " <td>Heliconius_wing_old_photos_2001_2019_part3.csv</td>\n",
769
+ " <td>https://zenodo.org/record/2553977</td>\n",
770
+ " </tr>\n",
771
+ " <tr>\n",
772
+ " <th>47712</th>\n",
773
+ " <td>CAM050147</td>\n",
774
+ " <td>26197</td>\n",
775
+ " <td>CAM050147_DS1_HW_IMG_8537_cut_3.tif</td>\n",
776
+ " <td>Heliconius_wing_old_photos_2001_2019_part3.csv</td>\n",
777
+ " <td>https://zenodo.org/record/2553977</td>\n",
778
+ " </tr>\n",
779
+ " <tr>\n",
780
+ " <th>47637</th>\n",
781
+ " <td>CAM050006</td>\n",
782
+ " <td>26126</td>\n",
783
+ " <td>CAM050006_S1_17_Hsar_mut_V_8296_wb_cut.tif</td>\n",
784
+ " <td>Heliconius_wing_old_photos_2001_2019_part3.csv</td>\n",
785
+ " <td>https://zenodo.org/record/2553977</td>\n",
786
+ " </tr>\n",
787
+ " <tr>\n",
788
+ " <th>47626</th>\n",
789
+ " <td>CAM050001</td>\n",
790
+ " <td>26118</td>\n",
791
+ " <td>CAM050001_S1_5_Hs_mut_D_wb_cut.tif</td>\n",
792
+ " <td>Heliconius_wing_old_photos_2001_2019_part3.csv</td>\n",
793
+ " <td>https://zenodo.org/record/2553977</td>\n",
794
+ " </tr>\n",
795
+ " <tr>\n",
796
+ " <th>47692</th>\n",
797
+ " <td>CAM050052</td>\n",
798
+ " <td>26153</td>\n",
799
+ " <td>CAM050052_M1_10_Hmr_mut_V_cut.tif</td>\n",
800
+ " <td>Heliconius_wing_old_photos_2001_2019_part3.csv</td>\n",
801
+ " <td>https://zenodo.org/record/2553977</td>\n",
802
+ " </tr>\n",
803
+ " <tr>\n",
804
+ " <th>47673</th>\n",
805
+ " <td>CAM050026</td>\n",
806
+ " <td>26147</td>\n",
807
+ " <td>CAM050026_S4_1_Hs_mut_V_IMG_8453_wb_cut.tif</td>\n",
808
+ " <td>Heliconius_wing_old_photos_2001_2019_part3.csv</td>\n",
809
+ " <td>https://zenodo.org/record/2553977</td>\n",
810
+ " </tr>\n",
811
+ " </tbody>\n",
812
+ "</table>\n",
813
+ "</div>"
814
+ ],
815
+ "text/plain": [
816
+ " CAMID X Image_name \\\n",
817
+ "47693 CAM050052 26152 CAM050052_M1_10_Hmr_mut_D_cut.tif \n",
818
+ "47694 CAM050063 26155 CAM050063_M7_17_Hmr_mut_V_IMG_8293_wb_cut.tif \n",
819
+ "47712 CAM050147 26197 CAM050147_DS1_HW_IMG_8537_cut_3.tif \n",
820
+ "47637 CAM050006 26126 CAM050006_S1_17_Hsar_mut_V_8296_wb_cut.tif \n",
821
+ "47626 CAM050001 26118 CAM050001_S1_5_Hs_mut_D_wb_cut.tif \n",
822
+ "47692 CAM050052 26153 CAM050052_M1_10_Hmr_mut_V_cut.tif \n",
823
+ "47673 CAM050026 26147 CAM050026_S4_1_Hs_mut_V_IMG_8453_wb_cut.tif \n",
824
+ "\n",
825
+ " zenodo_name \\\n",
826
+ "47693 Heliconius_wing_old_photos_2001_2019_part3.csv \n",
827
+ "47694 Heliconius_wing_old_photos_2001_2019_part3.csv \n",
828
+ "47712 Heliconius_wing_old_photos_2001_2019_part3.csv \n",
829
+ "47637 Heliconius_wing_old_photos_2001_2019_part3.csv \n",
830
+ "47626 Heliconius_wing_old_photos_2001_2019_part3.csv \n",
831
+ "47692 Heliconius_wing_old_photos_2001_2019_part3.csv \n",
832
+ "47673 Heliconius_wing_old_photos_2001_2019_part3.csv \n",
833
+ "\n",
834
+ " zenodo_link \n",
835
+ "47693 https://zenodo.org/record/2553977 \n",
836
+ "47694 https://zenodo.org/record/2553977 \n",
837
+ "47712 https://zenodo.org/record/2553977 \n",
838
+ "47637 https://zenodo.org/record/2553977 \n",
839
+ "47626 https://zenodo.org/record/2553977 \n",
840
+ "47692 https://zenodo.org/record/2553977 \n",
841
+ "47673 https://zenodo.org/record/2553977 "
842
+ ]
843
+ },
844
+ "execution_count": 11,
845
+ "metadata": {},
846
+ "output_type": "execute_result"
847
+ }
848
+ ],
849
+ "source": [
850
+ "jiggins_imgs[jiggins_imgs.Image_name.str.contains('tif')].sample(7)"
851
+ ]
852
+ },
853
+ {
854
+ "cell_type": "code",
855
+ "execution_count": 12,
856
+ "metadata": {},
857
+ "outputs": [
858
+ {
859
+ "data": {
860
+ "text/html": [
861
+ "<div>\n",
862
+ "<style scoped>\n",
863
+ " .dataframe tbody tr th:only-of-type {\n",
864
+ " vertical-align: middle;\n",
865
+ " }\n",
866
+ "\n",
867
+ " .dataframe tbody tr th {\n",
868
+ " vertical-align: top;\n",
869
+ " }\n",
870
+ "\n",
871
+ " .dataframe thead th {\n",
872
+ " text-align: right;\n",
873
+ " }\n",
874
+ "</style>\n",
875
+ "<table border=\"1\" class=\"dataframe\">\n",
876
+ " <thead>\n",
877
+ " <tr style=\"text-align: right;\">\n",
878
+ " <th></th>\n",
879
+ " <th>CAMID</th>\n",
880
+ " <th>X</th>\n",
881
+ " <th>Image_name</th>\n",
882
+ " <th>zenodo_name</th>\n",
883
+ " <th>zenodo_link</th>\n",
884
+ " </tr>\n",
885
+ " </thead>\n",
886
+ " <tbody>\n",
887
+ " <tr>\n",
888
+ " <th>42543</th>\n",
889
+ " <td>CAM044049</td>\n",
890
+ " <td>32915</td>\n",
891
+ " <td>CAM044049_d.CR2</td>\n",
892
+ " <td>batch2.Peru.image.names.Zenodo.csv</td>\n",
893
+ " <td>https://zenodo.org/record/4287444</td>\n",
894
+ " </tr>\n",
895
+ " <tr>\n",
896
+ " <th>44160</th>\n",
897
+ " <td>CAM044261</td>\n",
898
+ " <td>36392</td>\n",
899
+ " <td>CAM044261_d.JPG</td>\n",
900
+ " <td>batch3.Peru.image.names.Zenodo.csv</td>\n",
901
+ " <td>https://zenodo.org/record/4288250</td>\n",
902
+ " </tr>\n",
903
+ " <tr>\n",
904
+ " <th>14298</th>\n",
905
+ " <td>CAM010848</td>\n",
906
+ " <td>27458</td>\n",
907
+ " <td>CAM010848_d.JPG</td>\n",
908
+ " <td>2001_2.broods.batch.1.csv</td>\n",
909
+ " <td>https://zenodo.org/record/2549524</td>\n",
910
+ " </tr>\n",
911
+ " <tr>\n",
912
+ " <th>19141</th>\n",
913
+ " <td>CAM016524</td>\n",
914
+ " <td>759</td>\n",
915
+ " <td>CAM016524_d.JPG</td>\n",
916
+ " <td>CAM.coll.images.batch1.csv</td>\n",
917
+ " <td>https://zenodo.org/record/1247307</td>\n",
918
+ " </tr>\n",
919
+ " <tr>\n",
920
+ " <th>3229</th>\n",
921
+ " <td>19N2383</td>\n",
922
+ " <td>22175</td>\n",
923
+ " <td>19N2383_d.JPG</td>\n",
924
+ " <td>0.sheffield.ps.nn.ikiam.batch2.csv</td>\n",
925
+ " <td>https://zenodo.org/record/4288311</td>\n",
926
+ " </tr>\n",
927
+ " <tr>\n",
928
+ " <th>34948</th>\n",
929
+ " <td>CAM041352</td>\n",
930
+ " <td>14340</td>\n",
931
+ " <td>CAM041352_d.JPG</td>\n",
932
+ " <td>CAM.coll.images.batch9.csv</td>\n",
933
+ " <td>https://zenodo.org/record/2714333</td>\n",
934
+ " </tr>\n",
935
+ " <tr>\n",
936
+ " <th>28072</th>\n",
937
+ " <td>CAM021080</td>\n",
938
+ " <td>11587</td>\n",
939
+ " <td>CAM021080_d.JPG</td>\n",
940
+ " <td>CAM.coll.images.batch7.csv</td>\n",
941
+ " <td>https://zenodo.org/record/2702457</td>\n",
942
+ " </tr>\n",
943
+ " </tbody>\n",
944
+ "</table>\n",
945
+ "</div>"
946
+ ],
947
+ "text/plain": [
948
+ " CAMID X Image_name zenodo_name \\\n",
949
+ "42543 CAM044049 32915 CAM044049_d.CR2 batch2.Peru.image.names.Zenodo.csv \n",
950
+ "44160 CAM044261 36392 CAM044261_d.JPG batch3.Peru.image.names.Zenodo.csv \n",
951
+ "14298 CAM010848 27458 CAM010848_d.JPG 2001_2.broods.batch.1.csv \n",
952
+ "19141 CAM016524 759 CAM016524_d.JPG CAM.coll.images.batch1.csv \n",
953
+ "3229 19N2383 22175 19N2383_d.JPG 0.sheffield.ps.nn.ikiam.batch2.csv \n",
954
+ "34948 CAM041352 14340 CAM041352_d.JPG CAM.coll.images.batch9.csv \n",
955
+ "28072 CAM021080 11587 CAM021080_d.JPG CAM.coll.images.batch7.csv \n",
956
+ "\n",
957
+ " zenodo_link \n",
958
+ "42543 https://zenodo.org/record/4287444 \n",
959
+ "44160 https://zenodo.org/record/4288250 \n",
960
+ "14298 https://zenodo.org/record/2549524 \n",
961
+ "19141 https://zenodo.org/record/1247307 \n",
962
+ "3229 https://zenodo.org/record/4288311 \n",
963
+ "34948 https://zenodo.org/record/2714333 \n",
964
+ "28072 https://zenodo.org/record/2702457 "
965
+ ]
966
+ },
967
+ "execution_count": 12,
968
+ "metadata": {},
969
+ "output_type": "execute_result"
970
+ }
971
+ ],
972
+ "source": [
973
+ "jiggins_imgs[jiggins_imgs.Image_name.str.contains('d.')].sample(7)"
974
+ ]
975
+ },
976
+ {
977
+ "cell_type": "code",
978
+ "execution_count": 13,
979
+ "metadata": {},
980
+ "outputs": [
981
+ {
982
+ "name": "stdout",
983
+ "output_type": "stream",
984
+ "text": [
985
+ "{'JPG', 'CR2', 'tif', 'jpeg', 'JPG(1)', 'jpg'}\n"
986
+ ]
987
+ }
988
+ ],
989
+ "source": [
990
+ "check_filetypes = []\n",
991
+ "for img_name in list(jiggins_imgs.Image_name.unique()):\n",
992
+ " check_filetypes.append(img_name.split(\".\")[1])\n",
993
+ "\n",
994
+ "print(set(check_filetypes))"
995
+ ]
996
+ },
997
+ {
998
+ "cell_type": "code",
999
+ "execution_count": 14,
1000
+ "metadata": {},
1001
+ "outputs": [],
1002
+ "source": [
1003
+ "# Note CR2 is raw, may be duplicates, would need conversion\n",
1004
+ "file_types = [\"JPG\", \"jpg\", \"jpeg\", \"tif\", \"JPG(1)\", \"CR2\"]"
1005
+ ]
1006
+ },
1007
+ {
1008
+ "cell_type": "code",
1009
+ "execution_count": 15,
1010
+ "metadata": {},
1011
+ "outputs": [
1012
+ {
1013
+ "data": {
1014
+ "text/plain": [
1015
+ "37821"
1016
+ ]
1017
+ },
1018
+ "execution_count": 15,
1019
+ "metadata": {},
1020
+ "output_type": "execute_result"
1021
+ }
1022
+ ],
1023
+ "source": [
1024
+ "images = []\n",
1025
+ "\n",
1026
+ "for img_name in list(jiggins_imgs.Image_name.unique()):\n",
1027
+ " if img_name.split(\".\")[1] in file_types:\n",
1028
+ " images.append(img_name)\n",
1029
+ "\n",
1030
+ "len(images)"
1031
+ ]
1032
+ },
1033
+ {
1034
+ "cell_type": "code",
1035
+ "execution_count": 16,
1036
+ "metadata": {},
1037
+ "outputs": [
1038
+ {
1039
+ "name": "stdout",
1040
+ "output_type": "stream",
1041
+ "text": [
1042
+ "<class 'pandas.core.frame.DataFrame'>\n",
1043
+ "Index: 49359 entries, 433 to 49791\n",
1044
+ "Data columns (total 5 columns):\n",
1045
+ " # Column Non-Null Count Dtype \n",
1046
+ "--- ------ -------------- ----- \n",
1047
+ " 0 CAMID 49359 non-null object\n",
1048
+ " 1 X 49359 non-null int64 \n",
1049
+ " 2 Image_name 49359 non-null object\n",
1050
+ " 3 zenodo_name 49359 non-null object\n",
1051
+ " 4 zenodo_link 49359 non-null object\n",
1052
+ "dtypes: int64(1), object(4)\n",
1053
+ "memory usage: 2.3+ MB\n"
1054
+ ]
1055
+ }
1056
+ ],
1057
+ "source": [
1058
+ "img = jiggins_imgs[jiggins_imgs.Image_name.isin(images)]\n",
1059
+ "img.info()"
1060
+ ]
1061
+ },
1062
+ {
1063
+ "cell_type": "code",
1064
+ "execution_count": 17,
1065
+ "metadata": {},
1066
+ "outputs": [],
1067
+ "source": [
1068
+ "def get_file_type(filename):\n",
1069
+ " jpgs = [\"JPG\", \"jpg\", \"jpeg\", \"JPG(1)\"]\n",
1070
+ " file_type = filename.split(\".\")[1]\n",
1071
+ " if file_type in jpgs:\n",
1072
+ " return \"jpg\"\n",
1073
+ " elif file_type == \"tif\":\n",
1074
+ " return \"tif\"\n",
1075
+ " elif file_type == \"CR2\":\n",
1076
+ " return \"raw\"\n",
1077
+ " else:\n",
1078
+ " print(f\"{file_type} does not match known file types\")\n",
1079
+ " return None"
1080
+ ]
1081
+ },
1082
+ {
1083
+ "cell_type": "code",
1084
+ "execution_count": 18,
1085
+ "metadata": {},
1086
+ "outputs": [
1087
+ {
1088
+ "name": "stdout",
1089
+ "output_type": "stream",
1090
+ "text": [
1091
+ "<class 'pandas.core.frame.DataFrame'>\n",
1092
+ "Index: 49359 entries, 433 to 49791\n",
1093
+ "Data columns (total 6 columns):\n",
1094
+ " # Column Non-Null Count Dtype \n",
1095
+ "--- ------ -------------- ----- \n",
1096
+ " 0 CAMID 49359 non-null object\n",
1097
+ " 1 X 49359 non-null int64 \n",
1098
+ " 2 Image_name 49359 non-null object\n",
1099
+ " 3 zenodo_name 49359 non-null object\n",
1100
+ " 4 zenodo_link 49359 non-null object\n",
1101
+ " 5 file_type 49359 non-null object\n",
1102
+ "dtypes: int64(1), object(5)\n",
1103
+ "memory usage: 2.6+ MB\n"
1104
+ ]
1105
+ }
1106
+ ],
1107
+ "source": [
1108
+ "img[\"file_type\"] = img[\"Image_name\"].apply(get_file_type)\n",
1109
+ "img.info()"
1110
+ ]
1111
+ },
1112
+ {
1113
+ "cell_type": "code",
1114
+ "execution_count": 20,
1115
+ "metadata": {},
1116
+ "outputs": [],
1117
+ "source": [
1118
+ "img.to_csv(\"../zendo_img_master.csv\", index = False)"
1119
+ ]
1120
+ },
1121
+ {
1122
+ "cell_type": "code",
1123
+ "execution_count": 21,
1124
+ "metadata": {},
1125
+ "outputs": [
1126
+ {
1127
+ "name": "stdout",
1128
+ "output_type": "stream",
1129
+ "text": [
1130
+ "Unnamed: 0 49956\n",
1131
+ "CAMID 12586\n",
1132
+ "X 49956\n",
1133
+ "Image_name 37843\n",
1134
+ "dtype: int64\n",
1135
+ "\n",
1136
+ "CAMID 12586\n",
1137
+ "X 49359\n",
1138
+ "Image_name 37821\n",
1139
+ "zenodo_name 36\n",
1140
+ "dtype: int64\n"
1141
+ ]
1142
+ }
1143
+ ],
1144
+ "source": [
1145
+ "print(jiggins[list(jiggins.columns)[:4]].nunique())\n",
1146
+ "print()\n",
1147
+ "print(img[list(img.columns[:4])].nunique())"
1148
+ ]
1149
+ },
1150
+ {
1151
+ "cell_type": "code",
1152
+ "execution_count": 22,
1153
+ "metadata": {},
1154
+ "outputs": [
1155
+ {
1156
+ "name": "stdout",
1157
+ "output_type": "stream",
1158
+ "text": [
1159
+ "<class 'pandas.core.frame.DataFrame'>\n",
1160
+ "RangeIndex: 49956 entries, 0 to 49955\n",
1161
+ "Data columns (total 4 columns):\n",
1162
+ " # Column Non-Null Count Dtype \n",
1163
+ "--- ------ -------------- ----- \n",
1164
+ " 0 Unnamed: 0 49956 non-null int64 \n",
1165
+ " 1 CAMID 49359 non-null object\n",
1166
+ " 2 X 49956 non-null int64 \n",
1167
+ " 3 Image_name 49545 non-null object\n",
1168
+ "dtypes: int64(2), object(2)\n",
1169
+ "memory usage: 1.5+ MB\n",
1170
+ "None\n",
1171
+ "\n",
1172
+ "<class 'pandas.core.frame.DataFrame'>\n",
1173
+ "Index: 49359 entries, 433 to 49791\n",
1174
+ "Data columns (total 4 columns):\n",
1175
+ " # Column Non-Null Count Dtype \n",
1176
+ "--- ------ -------------- ----- \n",
1177
+ " 0 CAMID 49359 non-null object\n",
1178
+ " 1 X 49359 non-null int64 \n",
1179
+ " 2 Image_name 49359 non-null object\n",
1180
+ " 3 zenodo_name 49359 non-null object\n",
1181
+ "dtypes: int64(1), object(3)\n",
1182
+ "memory usage: 1.9+ MB\n",
1183
+ "None\n"
1184
+ ]
1185
+ }
1186
+ ],
1187
+ "source": [
1188
+ "print(jiggins[list(jiggins.columns)[:4]].info())\n",
1189
+ "print()\n",
1190
+ "print(img[list(img.columns[:4])].info())"
1191
+ ]
1192
+ },
1193
+ {
1194
+ "cell_type": "markdown",
1195
+ "metadata": {},
1196
+ "source": [
1197
+ "We want to match these up on `X`, since all entries have a value and it is unique."
1198
+ ]
1199
+ },
1200
+ {
1201
+ "cell_type": "code",
1202
+ "execution_count": 23,
1203
+ "metadata": {},
1204
+ "outputs": [
1205
+ {
1206
+ "name": "stdout",
1207
+ "output_type": "stream",
1208
+ "text": [
1209
+ "<class 'pandas.core.frame.DataFrame'>\n",
1210
+ "Index: 49359 entries, 433 to 49791\n",
1211
+ "Data columns (total 25 columns):\n",
1212
+ " # Column Non-Null Count Dtype \n",
1213
+ "--- ------ -------------- ----- \n",
1214
+ " 0 Unnamed: 0 49359 non-null int64 \n",
1215
+ " 1 CAMID 49359 non-null object \n",
1216
+ " 2 X 49359 non-null int64 \n",
1217
+ " 3 Image_name 49359 non-null object \n",
1218
+ " 4 Side 48288 non-null object \n",
1219
+ " 5 zenodo_name 49359 non-null object \n",
1220
+ " 6 zenodo_link 49359 non-null object \n",
1221
+ " 7 Sequence 48424 non-null object \n",
1222
+ " 8 Taxonomic.Name 45473 non-null object \n",
1223
+ " 9 Locality 34015 non-null object \n",
1224
+ " 10 Sample.accession 5884 non-null object \n",
1225
+ " 11 Collected.by 5280 non-null object \n",
1226
+ " 12 Other.Id 14382 non-null object \n",
1227
+ " 13 Collected.By 0 non-null float64\n",
1228
+ " 14 Date 33718 non-null object \n",
1229
+ " 15 Dataset 40405 non-null object \n",
1230
+ " 16 Store 39485 non-null object \n",
1231
+ " 17 Eclosion.Date 97 non-null object \n",
1232
+ " 18 Brood 14942 non-null object \n",
1233
+ " 19 Death.Date 318 non-null object \n",
1234
+ " 20 Cross.Type 5133 non-null object \n",
1235
+ " 21 Stage 15 non-null object \n",
1236
+ " 22 Sex 36243 non-null object \n",
1237
+ " 23 Unit.Type 33890 non-null object \n",
1238
+ " 24 Verbatim.Coordinates 0 non-null float64\n",
1239
+ "dtypes: float64(2), int64(2), object(21)\n",
1240
+ "memory usage: 9.8+ MB\n"
1241
+ ]
1242
+ }
1243
+ ],
1244
+ "source": [
1245
+ "df_img = jiggins.loc[jiggins.X.isin(list(img.X))]\n",
1246
+ "df_img.info()"
1247
+ ]
1248
+ },
1249
+ {
1250
+ "cell_type": "markdown",
1251
+ "metadata": {},
1252
+ "source": [
1253
+ "Rename columns to have underscore"
1254
+ ]
1255
+ },
1256
+ {
1257
+ "cell_type": "code",
1258
+ "execution_count": 24,
1259
+ "metadata": {},
1260
+ "outputs": [
1261
+ {
1262
+ "name": "stderr",
1263
+ "output_type": "stream",
1264
+ "text": [
1265
+ "/var/folders/nv/f0fq1p1n1_3b11x579py_0q80000gq/T/ipykernel_66533/3055364590.py:1: SettingWithCopyWarning: \n",
1266
+ "A value is trying to be set on a copy of a slice from a DataFrame\n",
1267
+ "\n",
1268
+ "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
1269
+ " df_img.rename(columns = {\"Side\": \"View\",\n"
1270
+ ]
1271
+ }
1272
+ ],
1273
+ "source": [
1274
+ "df_img.rename(columns = {\"Side\": \"View\",\n",
1275
+ " \"Taxonomic.Name\": \"Taxonomic_Name\",\n",
1276
+ " \"Cross.Type\": \"Cross_Type\",\n",
1277
+ " \"Sample.accession\": \"Sample_accession\",\n",
1278
+ " \"Collected.by\": \"Collected_by\",\n",
1279
+ " \"Other.Id\": \"Other_ID\",\n",
1280
+ " \"Death.Date\": \"Death_Date\",\n",
1281
+ " \"Unit.Type\": \"Unit_Type\"},\n",
1282
+ " inplace = True)"
1283
+ ]
1284
+ },
1285
+ {
1286
+ "cell_type": "code",
1287
+ "execution_count": 25,
1288
+ "metadata": {},
1289
+ "outputs": [],
1290
+ "source": [
1291
+ "null_cols = [\"Unnamed: 0\", \"Collected.By\", \"Eclosion.Date\", \"Verbatim.Coordinates\"]\n",
1292
+ "non_null_cols = [col for col in list(df_img.columns) if col not in null_cols]"
1293
+ ]
1294
+ },
1295
+ {
1296
+ "cell_type": "code",
1297
+ "execution_count": 26,
1298
+ "metadata": {},
1299
+ "outputs": [],
1300
+ "source": [
1301
+ "df_img = df_img[non_null_cols]"
1302
+ ]
1303
+ },
1304
+ {
1305
+ "cell_type": "code",
1306
+ "execution_count": 27,
1307
+ "metadata": {},
1308
+ "outputs": [
1309
+ {
1310
+ "data": {
1311
+ "text/html": [
1312
+ "<div>\n",
1313
+ "<style scoped>\n",
1314
+ " .dataframe tbody tr th:only-of-type {\n",
1315
+ " vertical-align: middle;\n",
1316
+ " }\n",
1317
+ "\n",
1318
+ " .dataframe tbody tr th {\n",
1319
+ " vertical-align: top;\n",
1320
+ " }\n",
1321
+ "\n",
1322
+ " .dataframe thead th {\n",
1323
+ " text-align: right;\n",
1324
+ " }\n",
1325
+ "</style>\n",
1326
+ "<table border=\"1\" class=\"dataframe\">\n",
1327
+ " <thead>\n",
1328
+ " <tr style=\"text-align: right;\">\n",
1329
+ " <th></th>\n",
1330
+ " <th>CAMID</th>\n",
1331
+ " <th>X</th>\n",
1332
+ " <th>Image_name</th>\n",
1333
+ " <th>View</th>\n",
1334
+ " <th>zenodo_name</th>\n",
1335
+ " <th>zenodo_link</th>\n",
1336
+ " <th>Sequence</th>\n",
1337
+ " <th>Taxonomic_Name</th>\n",
1338
+ " <th>Locality</th>\n",
1339
+ " <th>Sample_accession</th>\n",
1340
+ " <th>...</th>\n",
1341
+ " <th>Other_ID</th>\n",
1342
+ " <th>Date</th>\n",
1343
+ " <th>Dataset</th>\n",
1344
+ " <th>Store</th>\n",
1345
+ " <th>Brood</th>\n",
1346
+ " <th>Death_Date</th>\n",
1347
+ " <th>Cross_Type</th>\n",
1348
+ " <th>Stage</th>\n",
1349
+ " <th>Sex</th>\n",
1350
+ " <th>Unit_Type</th>\n",
1351
+ " </tr>\n",
1352
+ " </thead>\n",
1353
+ " <tbody>\n",
1354
+ " <tr>\n",
1355
+ " <th>433</th>\n",
1356
+ " <td>14N004</td>\n",
1357
+ " <td>15131</td>\n",
1358
+ " <td>14N004_d.JPG</td>\n",
1359
+ " <td>dorsal</td>\n",
1360
+ " <td>0.4.nn.requests2.csv</td>\n",
1361
+ " <td>https://zenodo.org/record/4289223</td>\n",
1362
+ " <td>4</td>\n",
1363
+ " <td>NaN</td>\n",
1364
+ " <td>NaN</td>\n",
1365
+ " <td>NaN</td>\n",
1366
+ " <td>...</td>\n",
1367
+ " <td>NaN</td>\n",
1368
+ " <td>NaN</td>\n",
1369
+ " <td>Nadeau Sheffield</td>\n",
1370
+ " <td>NaN</td>\n",
1371
+ " <td>NaN</td>\n",
1372
+ " <td>NaN</td>\n",
1373
+ " <td>NaN</td>\n",
1374
+ " <td>NaN</td>\n",
1375
+ " <td>NaN</td>\n",
1376
+ " <td>NaN</td>\n",
1377
+ " </tr>\n",
1378
+ " <tr>\n",
1379
+ " <th>434</th>\n",
1380
+ " <td>14N004</td>\n",
1381
+ " <td>15132</td>\n",
1382
+ " <td>14N004_v.JPG</td>\n",
1383
+ " <td>ventral</td>\n",
1384
+ " <td>0.4.nn.requests2.csv</td>\n",
1385
+ " <td>https://zenodo.org/record/4289223</td>\n",
1386
+ " <td>4</td>\n",
1387
+ " <td>NaN</td>\n",
1388
+ " <td>NaN</td>\n",
1389
+ " <td>NaN</td>\n",
1390
+ " <td>...</td>\n",
1391
+ " <td>NaN</td>\n",
1392
+ " <td>NaN</td>\n",
1393
+ " <td>Nadeau Sheffield</td>\n",
1394
+ " <td>NaN</td>\n",
1395
+ " <td>NaN</td>\n",
1396
+ " <td>NaN</td>\n",
1397
+ " <td>NaN</td>\n",
1398
+ " <td>NaN</td>\n",
1399
+ " <td>NaN</td>\n",
1400
+ " <td>NaN</td>\n",
1401
+ " </tr>\n",
1402
+ " <tr>\n",
1403
+ " <th>435</th>\n",
1404
+ " <td>14N009</td>\n",
1405
+ " <td>15134</td>\n",
1406
+ " <td>14N009_v.JPG</td>\n",
1407
+ " <td>ventral</td>\n",
1408
+ " <td>0.4.nn.requests2.csv</td>\n",
1409
+ " <td>https://zenodo.org/record/4289223</td>\n",
1410
+ " <td>9</td>\n",
1411
+ " <td>NaN</td>\n",
1412
+ " <td>NaN</td>\n",
1413
+ " <td>NaN</td>\n",
1414
+ " <td>...</td>\n",
1415
+ " <td>NaN</td>\n",
1416
+ " <td>NaN</td>\n",
1417
+ " <td>Nadeau Sheffield</td>\n",
1418
+ " <td>NaN</td>\n",
1419
+ " <td>NaN</td>\n",
1420
+ " <td>NaN</td>\n",
1421
+ " <td>NaN</td>\n",
1422
+ " <td>NaN</td>\n",
1423
+ " <td>NaN</td>\n",
1424
+ " <td>NaN</td>\n",
1425
+ " </tr>\n",
1426
+ " <tr>\n",
1427
+ " <th>436</th>\n",
1428
+ " <td>14N009</td>\n",
1429
+ " <td>15133</td>\n",
1430
+ " <td>14N009_d.JPG</td>\n",
1431
+ " <td>dorsal</td>\n",
1432
+ " <td>0.4.nn.requests2.csv</td>\n",
1433
+ " <td>https://zenodo.org/record/4289223</td>\n",
1434
+ " <td>9</td>\n",
1435
+ " <td>NaN</td>\n",
1436
+ " <td>NaN</td>\n",
1437
+ " <td>NaN</td>\n",
1438
+ " <td>...</td>\n",
1439
+ " <td>NaN</td>\n",
1440
+ " <td>NaN</td>\n",
1441
+ " <td>Nadeau Sheffield</td>\n",
1442
+ " <td>NaN</td>\n",
1443
+ " <td>NaN</td>\n",
1444
+ " <td>NaN</td>\n",
1445
+ " <td>NaN</td>\n",
1446
+ " <td>NaN</td>\n",
1447
+ " <td>NaN</td>\n",
1448
+ " <td>NaN</td>\n",
1449
+ " </tr>\n",
1450
+ " <tr>\n",
1451
+ " <th>437</th>\n",
1452
+ " <td>14N014</td>\n",
1453
+ " <td>15136</td>\n",
1454
+ " <td>14N014_v.JPG</td>\n",
1455
+ " <td>ventral</td>\n",
1456
+ " <td>0.4.nn.requests2.csv</td>\n",
1457
+ " <td>https://zenodo.org/record/4289223</td>\n",
1458
+ " <td>14</td>\n",
1459
+ " <td>NaN</td>\n",
1460
+ " <td>NaN</td>\n",
1461
+ " <td>NaN</td>\n",
1462
+ " <td>...</td>\n",
1463
+ " <td>NaN</td>\n",
1464
+ " <td>NaN</td>\n",
1465
+ " <td>Nadeau Sheffield</td>\n",
1466
+ " <td>NaN</td>\n",
1467
+ " <td>NaN</td>\n",
1468
+ " <td>NaN</td>\n",
1469
+ " <td>NaN</td>\n",
1470
+ " <td>NaN</td>\n",
1471
+ " <td>NaN</td>\n",
1472
+ " <td>NaN</td>\n",
1473
+ " </tr>\n",
1474
+ " </tbody>\n",
1475
+ "</table>\n",
1476
+ "<p>5 rows × 21 columns</p>\n",
1477
+ "</div>"
1478
+ ],
1479
+ "text/plain": [
1480
+ " CAMID X Image_name View zenodo_name \\\n",
1481
+ "433 14N004 15131 14N004_d.JPG dorsal 0.4.nn.requests2.csv \n",
1482
+ "434 14N004 15132 14N004_v.JPG ventral 0.4.nn.requests2.csv \n",
1483
+ "435 14N009 15134 14N009_v.JPG ventral 0.4.nn.requests2.csv \n",
1484
+ "436 14N009 15133 14N009_d.JPG dorsal 0.4.nn.requests2.csv \n",
1485
+ "437 14N014 15136 14N014_v.JPG ventral 0.4.nn.requests2.csv \n",
1486
+ "\n",
1487
+ " zenodo_link Sequence Taxonomic_Name Locality \\\n",
1488
+ "433 https://zenodo.org/record/4289223 4 NaN NaN \n",
1489
+ "434 https://zenodo.org/record/4289223 4 NaN NaN \n",
1490
+ "435 https://zenodo.org/record/4289223 9 NaN NaN \n",
1491
+ "436 https://zenodo.org/record/4289223 9 NaN NaN \n",
1492
+ "437 https://zenodo.org/record/4289223 14 NaN NaN \n",
1493
+ "\n",
1494
+ " Sample_accession ... Other_ID Date Dataset Store Brood \\\n",
1495
+ "433 NaN ... NaN NaN Nadeau Sheffield NaN NaN \n",
1496
+ "434 NaN ... NaN NaN Nadeau Sheffield NaN NaN \n",
1497
+ "435 NaN ... NaN NaN Nadeau Sheffield NaN NaN \n",
1498
+ "436 NaN ... NaN NaN Nadeau Sheffield NaN NaN \n",
1499
+ "437 NaN ... NaN NaN Nadeau Sheffield NaN NaN \n",
1500
+ "\n",
1501
+ " Death_Date Cross_Type Stage Sex Unit_Type \n",
1502
+ "433 NaN NaN NaN NaN NaN \n",
1503
+ "434 NaN NaN NaN NaN NaN \n",
1504
+ "435 NaN NaN NaN NaN NaN \n",
1505
+ "436 NaN NaN NaN NaN NaN \n",
1506
+ "437 NaN NaN NaN NaN NaN \n",
1507
+ "\n",
1508
+ "[5 rows x 21 columns]"
1509
+ ]
1510
+ },
1511
+ "execution_count": 27,
1512
+ "metadata": {},
1513
+ "output_type": "execute_result"
1514
+ }
1515
+ ],
1516
+ "source": [
1517
+ "df_img.head()"
1518
+ ]
1519
+ },
1520
+ {
1521
+ "cell_type": "code",
1522
+ "execution_count": 28,
1523
+ "metadata": {},
1524
+ "outputs": [
1525
+ {
1526
+ "name": "stdout",
1527
+ "output_type": "stream",
1528
+ "text": [
1529
+ "<class 'pandas.core.frame.DataFrame'>\n",
1530
+ "Index: 49359 entries, 433 to 49791\n",
1531
+ "Data columns (total 22 columns):\n",
1532
+ " # Column Non-Null Count Dtype \n",
1533
+ "--- ------ -------------- ----- \n",
1534
+ " 0 CAMID 49359 non-null object\n",
1535
+ " 1 X 49359 non-null int64 \n",
1536
+ " 2 Image_name 49359 non-null object\n",
1537
+ " 3 View 48288 non-null object\n",
1538
+ " 4 zenodo_name 49359 non-null object\n",
1539
+ " 5 zenodo_link 49359 non-null object\n",
1540
+ " 6 Sequence 48424 non-null object\n",
1541
+ " 7 Taxonomic_Name 45473 non-null object\n",
1542
+ " 8 Locality 34015 non-null object\n",
1543
+ " 9 Sample_accession 5884 non-null object\n",
1544
+ " 10 Collected_by 5280 non-null object\n",
1545
+ " 11 Other_ID 14382 non-null object\n",
1546
+ " 12 Date 33718 non-null object\n",
1547
+ " 13 Dataset 40405 non-null object\n",
1548
+ " 14 Store 39485 non-null object\n",
1549
+ " 15 Brood 14942 non-null object\n",
1550
+ " 16 Death_Date 318 non-null object\n",
1551
+ " 17 Cross_Type 5133 non-null object\n",
1552
+ " 18 Stage 15 non-null object\n",
1553
+ " 19 Sex 36243 non-null object\n",
1554
+ " 20 Unit_Type 33890 non-null object\n",
1555
+ " 21 file_type 49359 non-null object\n",
1556
+ "dtypes: int64(1), object(21)\n",
1557
+ "memory usage: 8.7+ MB\n"
1558
+ ]
1559
+ }
1560
+ ],
1561
+ "source": [
1562
+ "df_img[\"file_type\"] = df_img[\"Image_name\"].apply(get_file_type)\n",
1563
+ "df_img.info()"
1564
+ ]
1565
+ },
1566
+ {
1567
+ "cell_type": "code",
1568
+ "execution_count": 29,
1569
+ "metadata": {},
1570
+ "outputs": [],
1571
+ "source": [
1572
+ "df_img.to_csv(\"../Jiggins_Zenodo_Img_Master.csv\", index = False)"
1573
+ ]
1574
+ },
1575
+ {
1576
+ "cell_type": "markdown",
1577
+ "metadata": {},
1578
+ "source": [
1579
+ "Remaining Question is just if the raw images are duplicated as jpgs or are unique. The `CAMID`'s correspond to samples (as noted in the [zenodo records](https://zenodo.org/record/4289223)), so we can check a single view for this."
1580
+ ]
1581
+ },
1582
+ {
1583
+ "cell_type": "code",
1584
+ "execution_count": 30,
1585
+ "metadata": {},
1586
+ "outputs": [
1587
+ {
1588
+ "data": {
1589
+ "text/plain": [
1590
+ "View\n",
1591
+ "dorsal 15128\n",
1592
+ "ventral 13424\n",
1593
+ "Dorsal 8360\n",
1594
+ "Ventral 8090\n",
1595
+ "ventral 1644\n",
1596
+ "forewing dorsal 406\n",
1597
+ "hindwing dorsal 406\n",
1598
+ "forewing ventral 406\n",
1599
+ "hindwing ventral 406\n",
1600
+ "Dorsal and Ventral 18\n",
1601
+ "Name: count, dtype: int64"
1602
+ ]
1603
+ },
1604
+ "execution_count": 30,
1605
+ "metadata": {},
1606
+ "output_type": "execute_result"
1607
+ }
1608
+ ],
1609
+ "source": [
1610
+ "df_img.View.value_counts()"
1611
+ ]
1612
+ },
1613
+ {
1614
+ "cell_type": "code",
1615
+ "execution_count": 31,
1616
+ "metadata": {},
1617
+ "outputs": [
1618
+ {
1619
+ "data": {
1620
+ "text/plain": [
1621
+ "['dorsal',\n",
1622
+ " 'Dorsal',\n",
1623
+ " 'Dorsal and Ventral',\n",
1624
+ " 'forewing dorsal',\n",
1625
+ " 'hindwing dorsal']"
1626
+ ]
1627
+ },
1628
+ "execution_count": 31,
1629
+ "metadata": {},
1630
+ "output_type": "execute_result"
1631
+ }
1632
+ ],
1633
+ "source": [
1634
+ "dorsal_labels = [view for view in list(df_img.View.dropna().unique()) if \"dorsal\" in view.lower()]\n",
1635
+ "dorsal_labels"
1636
+ ]
1637
+ },
1638
+ {
1639
+ "cell_type": "code",
1640
+ "execution_count": 32,
1641
+ "metadata": {},
1642
+ "outputs": [
1643
+ {
1644
+ "name": "stdout",
1645
+ "output_type": "stream",
1646
+ "text": [
1647
+ "<class 'pandas.core.frame.DataFrame'>\n",
1648
+ "Index: 24318 entries, 433 to 49790\n",
1649
+ "Data columns (total 22 columns):\n",
1650
+ " # Column Non-Null Count Dtype \n",
1651
+ "--- ------ -------------- ----- \n",
1652
+ " 0 CAMID 24318 non-null object\n",
1653
+ " 1 X 24318 non-null int64 \n",
1654
+ " 2 Image_name 24318 non-null object\n",
1655
+ " 3 View 24318 non-null object\n",
1656
+ " 4 zenodo_name 24318 non-null object\n",
1657
+ " 5 zenodo_link 24318 non-null object\n",
1658
+ " 6 Sequence 23851 non-null object\n",
1659
+ " 7 Taxonomic_Name 22511 non-null object\n",
1660
+ " 8 Locality 16773 non-null object\n",
1661
+ " 9 Sample_accession 2953 non-null object\n",
1662
+ " 10 Collected_by 2656 non-null object\n",
1663
+ " 11 Other_ID 6931 non-null object\n",
1664
+ " 12 Date 16847 non-null object\n",
1665
+ " 13 Dataset 19935 non-null object\n",
1666
+ " 14 Store 19894 non-null object\n",
1667
+ " 15 Brood 7264 non-null object\n",
1668
+ " 16 Death_Date 107 non-null object\n",
1669
+ " 17 Cross_Type 2572 non-null object\n",
1670
+ " 18 Stage 8 non-null object\n",
1671
+ " 19 Sex 17875 non-null object\n",
1672
+ " 20 Unit_Type 16693 non-null object\n",
1673
+ " 21 file_type 24318 non-null object\n",
1674
+ "dtypes: int64(1), object(21)\n",
1675
+ "memory usage: 4.3+ MB\n"
1676
+ ]
1677
+ }
1678
+ ],
1679
+ "source": [
1680
+ "df_img_dorsal = df_img.loc[df_img[\"View\"].isin(dorsal_labels)]\n",
1681
+ "df_img_dorsal.info()"
1682
+ ]
1683
+ },
1684
+ {
1685
+ "cell_type": "code",
1686
+ "execution_count": 33,
1687
+ "metadata": {},
1688
+ "outputs": [
1689
+ {
1690
+ "data": {
1691
+ "text/plain": [
1692
+ "CAMID 12296\n",
1693
+ "X 24318\n",
1694
+ "Image_name 18539\n",
1695
+ "View 5\n",
1696
+ "zenodo_name 36\n",
1697
+ "zenodo_link 32\n",
1698
+ "Sequence 11107\n",
1699
+ "Taxonomic_Name 359\n",
1700
+ "Locality 642\n",
1701
+ "Sample_accession 1564\n",
1702
+ "Collected_by 12\n",
1703
+ "Other_ID 2897\n",
1704
+ "Date 794\n",
1705
+ "Dataset 8\n",
1706
+ "Store 142\n",
1707
+ "Brood 217\n",
1708
+ "Death_Date 64\n",
1709
+ "Cross_Type 30\n",
1710
+ "Stage 1\n",
1711
+ "Sex 3\n",
1712
+ "Unit_Type 6\n",
1713
+ "file_type 3\n",
1714
+ "dtype: int64"
1715
+ ]
1716
+ },
1717
+ "execution_count": 33,
1718
+ "metadata": {},
1719
+ "output_type": "execute_result"
1720
+ }
1721
+ ],
1722
+ "source": [
1723
+ "df_img_dorsal.nunique()"
1724
+ ]
1725
+ },
1726
+ {
1727
+ "cell_type": "markdown",
1728
+ "metadata": {},
1729
+ "source": [
1730
+ "We still have repeated `CAMID`s."
1731
+ ]
1732
+ },
1733
+ {
1734
+ "cell_type": "code",
1735
+ "execution_count": 34,
1736
+ "metadata": {},
1737
+ "outputs": [
1738
+ {
1739
+ "name": "stderr",
1740
+ "output_type": "stream",
1741
+ "text": [
1742
+ "/var/folders/nv/f0fq1p1n1_3b11x579py_0q80000gq/T/ipykernel_66533/4002726096.py:1: SettingWithCopyWarning: \n",
1743
+ "A value is trying to be set on a copy of a slice from a DataFrame.\n",
1744
+ "Try using .loc[row_indexer,col_indexer] = value instead\n",
1745
+ "\n",
1746
+ "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
1747
+ " df_img_dorsal[\"CAM_Dupe\"] = df_img_dorsal.duplicated(subset = \"CAMID\", keep = False)\n"
1748
+ ]
1749
+ }
1750
+ ],
1751
+ "source": [
1752
+ "df_img_dorsal[\"CAM_Dupe\"] = df_img_dorsal.duplicated(subset = \"CAMID\", keep = False)"
1753
+ ]
1754
+ },
1755
+ {
1756
+ "cell_type": "code",
1757
+ "execution_count": 35,
1758
+ "metadata": {},
1759
+ "outputs": [
1760
+ {
1761
+ "data": {
1762
+ "text/plain": [
1763
+ "CAM_Dupe\n",
1764
+ "True 20765\n",
1765
+ "False 3553\n",
1766
+ "Name: count, dtype: int64"
1767
+ ]
1768
+ },
1769
+ "execution_count": 35,
1770
+ "metadata": {},
1771
+ "output_type": "execute_result"
1772
+ }
1773
+ ],
1774
+ "source": [
1775
+ "df_img_dorsal[\"CAM_Dupe\"].value_counts()"
1776
+ ]
1777
+ },
1778
+ {
1779
+ "cell_type": "code",
1780
+ "execution_count": 36,
1781
+ "metadata": {},
1782
+ "outputs": [
1783
+ {
1784
+ "name": "stdout",
1785
+ "output_type": "stream",
1786
+ "text": [
1787
+ "<class 'pandas.core.frame.DataFrame'>\n",
1788
+ "Index: 20765 entries, 709 to 49692\n",
1789
+ "Data columns (total 23 columns):\n",
1790
+ " # Column Non-Null Count Dtype \n",
1791
+ "--- ------ -------------- ----- \n",
1792
+ " 0 CAMID 20765 non-null object\n",
1793
+ " 1 X 20765 non-null int64 \n",
1794
+ " 2 Image_name 20765 non-null object\n",
1795
+ " 3 View 20765 non-null object\n",
1796
+ " 4 zenodo_name 20765 non-null object\n",
1797
+ " 5 zenodo_link 20765 non-null object\n",
1798
+ " 6 Sequence 20299 non-null object\n",
1799
+ " 7 Taxonomic_Name 19368 non-null object\n",
1800
+ " 8 Locality 15301 non-null object\n",
1801
+ " 9 Sample_accession 2657 non-null object\n",
1802
+ " 10 Collected_by 2653 non-null object\n",
1803
+ " 11 Other_ID 6107 non-null object\n",
1804
+ " 12 Date 15980 non-null object\n",
1805
+ " 13 Dataset 16862 non-null object\n",
1806
+ " 14 Store 17579 non-null object\n",
1807
+ " 15 Brood 5414 non-null object\n",
1808
+ " 16 Death_Date 26 non-null object\n",
1809
+ " 17 Cross_Type 2572 non-null object\n",
1810
+ " 18 Stage 0 non-null object\n",
1811
+ " 19 Sex 14897 non-null object\n",
1812
+ " 20 Unit_Type 13814 non-null object\n",
1813
+ " 21 file_type 20765 non-null object\n",
1814
+ " 22 CAM_Dupe 20765 non-null bool \n",
1815
+ "dtypes: bool(1), int64(1), object(21)\n",
1816
+ "memory usage: 3.7+ MB\n"
1817
+ ]
1818
+ }
1819
+ ],
1820
+ "source": [
1821
+ "duplicate_samples = df_img_dorsal.loc[df_img_dorsal[\"CAM_Dupe\"]]\n",
1822
+ "duplicate_samples.info()"
1823
+ ]
1824
+ },
1825
+ {
1826
+ "cell_type": "code",
1827
+ "execution_count": 37,
1828
+ "metadata": {},
1829
+ "outputs": [
1830
+ {
1831
+ "data": {
1832
+ "text/plain": [
1833
+ "CAMID 8743\n",
1834
+ "X 20765\n",
1835
+ "Image_name 14986\n",
1836
+ "View 5\n",
1837
+ "zenodo_name 32\n",
1838
+ "zenodo_link 31\n",
1839
+ "Sequence 8407\n",
1840
+ "Taxonomic_Name 328\n",
1841
+ "Locality 516\n",
1842
+ "Sample_accession 1268\n",
1843
+ "Collected_by 12\n",
1844
+ "Other_ID 2073\n",
1845
+ "Date 578\n",
1846
+ "Dataset 4\n",
1847
+ "Store 130\n",
1848
+ "Brood 144\n",
1849
+ "Death_Date 12\n",
1850
+ "Cross_Type 30\n",
1851
+ "Stage 0\n",
1852
+ "Sex 3\n",
1853
+ "Unit_Type 3\n",
1854
+ "file_type 3\n",
1855
+ "CAM_Dupe 1\n",
1856
+ "dtype: int64"
1857
+ ]
1858
+ },
1859
+ "execution_count": 37,
1860
+ "metadata": {},
1861
+ "output_type": "execute_result"
1862
+ }
1863
+ ],
1864
+ "source": [
1865
+ "duplicate_samples.nunique()"
1866
+ ]
1867
+ },
1868
+ {
1869
+ "cell_type": "markdown",
1870
+ "metadata": {},
1871
+ "source": [
1872
+ "All sources are impacted."
1873
+ ]
1874
+ },
1875
+ {
1876
+ "cell_type": "code",
1877
+ "execution_count": 38,
1878
+ "metadata": {},
1879
+ "outputs": [
1880
+ {
1881
+ "data": {
1882
+ "text/plain": [
1883
+ "file_type\n",
1884
+ "jpg 14788\n",
1885
+ "raw 5956\n",
1886
+ "tif 21\n",
1887
+ "Name: count, dtype: int64"
1888
+ ]
1889
+ },
1890
+ "execution_count": 38,
1891
+ "metadata": {},
1892
+ "output_type": "execute_result"
1893
+ }
1894
+ ],
1895
+ "source": [
1896
+ "duplicate_samples.file_type.value_counts()"
1897
+ ]
1898
+ },
1899
+ {
1900
+ "cell_type": "markdown",
1901
+ "metadata": {},
1902
+ "source": [
1903
+ "We will get some added duplication from `forewing dorsal` and `hindwing dorsal`, so we should filter those down to just one for a more accurate assessment."
1904
+ ]
1905
+ },
1906
+ {
1907
+ "cell_type": "code",
1908
+ "execution_count": 39,
1909
+ "metadata": {},
1910
+ "outputs": [
1911
+ {
1912
+ "data": {
1913
+ "text/plain": [
1914
+ "True 680\n",
1915
+ "False 132\n",
1916
+ "Name: count, dtype: int64"
1917
+ ]
1918
+ },
1919
+ "execution_count": 39,
1920
+ "metadata": {},
1921
+ "output_type": "execute_result"
1922
+ }
1923
+ ],
1924
+ "source": [
1925
+ "duplicate_samples.loc[duplicate_samples[\"View\"].isin([\"forewing dorsal\", \"hindwing dorsal\"])].duplicated(\"CAMID\", keep = \"first\").value_counts()"
1926
+ ]
1927
+ },
1928
+ {
1929
+ "cell_type": "code",
1930
+ "execution_count": 40,
1931
+ "metadata": {},
1932
+ "outputs": [
1933
+ {
1934
+ "data": {
1935
+ "text/plain": [
1936
+ "CAMID 132\n",
1937
+ "X 812\n",
1938
+ "Image_name 528\n",
1939
+ "View 2\n",
1940
+ "zenodo_name 3\n",
1941
+ "zenodo_link 3\n",
1942
+ "Sequence 132\n",
1943
+ "Taxonomic_Name 7\n",
1944
+ "Locality 59\n",
1945
+ "Sample_accession 0\n",
1946
+ "Collected_by 0\n",
1947
+ "Other_ID 127\n",
1948
+ "Date 16\n",
1949
+ "Dataset 1\n",
1950
+ "Store 17\n",
1951
+ "Brood 0\n",
1952
+ "Death_Date 0\n",
1953
+ "Cross_Type 0\n",
1954
+ "Stage 0\n",
1955
+ "Sex 0\n",
1956
+ "Unit_Type 0\n",
1957
+ "file_type 2\n",
1958
+ "CAM_Dupe 1\n",
1959
+ "dtype: int64"
1960
+ ]
1961
+ },
1962
+ "execution_count": 40,
1963
+ "metadata": {},
1964
+ "output_type": "execute_result"
1965
+ }
1966
+ ],
1967
+ "source": [
1968
+ "duplicate_samples.loc[duplicate_samples[\"View\"].isin([\"forewing dorsal\", \"hindwing dorsal\"])].nunique()"
1969
+ ]
1970
+ },
1971
+ {
1972
+ "cell_type": "markdown",
1973
+ "metadata": {},
1974
+ "source": [
1975
+ "This is only a couple zenodo links, so it is not contributing to the duplication across sources. It also covers two file types."
1976
+ ]
1977
+ },
1978
+ {
1979
+ "cell_type": "code",
1980
+ "execution_count": 41,
1981
+ "metadata": {},
1982
+ "outputs": [
1983
+ {
1984
+ "name": "stdout",
1985
+ "output_type": "stream",
1986
+ "text": [
1987
+ "<class 'pandas.core.frame.DataFrame'>\n",
1988
+ "Index: 3553 entries, 433 to 49790\n",
1989
+ "Data columns (total 23 columns):\n",
1990
+ " # Column Non-Null Count Dtype \n",
1991
+ "--- ------ -------------- ----- \n",
1992
+ " 0 CAMID 3553 non-null object\n",
1993
+ " 1 X 3553 non-null int64 \n",
1994
+ " 2 Image_name 3553 non-null object\n",
1995
+ " 3 View 3553 non-null object\n",
1996
+ " 4 zenodo_name 3553 non-null object\n",
1997
+ " 5 zenodo_link 3553 non-null object\n",
1998
+ " 6 Sequence 3552 non-null object\n",
1999
+ " 7 Taxonomic_Name 3143 non-null object\n",
2000
+ " 8 Locality 1472 non-null object\n",
2001
+ " 9 Sample_accession 296 non-null object\n",
2002
+ " 10 Collected_by 3 non-null object\n",
2003
+ " 11 Other_ID 824 non-null object\n",
2004
+ " 12 Date 867 non-null object\n",
2005
+ " 13 Dataset 3073 non-null object\n",
2006
+ " 14 Store 2315 non-null object\n",
2007
+ " 15 Brood 1850 non-null object\n",
2008
+ " 16 Death_Date 81 non-null object\n",
2009
+ " 17 Cross_Type 0 non-null object\n",
2010
+ " 18 Stage 8 non-null object\n",
2011
+ " 19 Sex 2978 non-null object\n",
2012
+ " 20 Unit_Type 2879 non-null object\n",
2013
+ " 21 file_type 3553 non-null object\n",
2014
+ " 22 CAM_Dupe 3553 non-null bool \n",
2015
+ "dtypes: bool(1), int64(1), object(21)\n",
2016
+ "memory usage: 641.9+ KB\n"
2017
+ ]
2018
+ }
2019
+ ],
2020
+ "source": [
2021
+ "unique_samples = df_img_dorsal.loc[~df_img_dorsal[\"CAM_Dupe\"]]\n",
2022
+ "unique_samples.info()"
2023
+ ]
2024
+ },
2025
+ {
2026
+ "cell_type": "code",
2027
+ "execution_count": 42,
2028
+ "metadata": {},
2029
+ "outputs": [
2030
+ {
2031
+ "data": {
2032
+ "text/plain": [
2033
+ "CAMID 3553\n",
2034
+ "X 3553\n",
2035
+ "Image_name 3553\n",
2036
+ "View 3\n",
2037
+ "zenodo_name 21\n",
2038
+ "zenodo_link 18\n",
2039
+ "Sequence 3016\n",
2040
+ "Taxonomic_Name 109\n",
2041
+ "Locality 160\n",
2042
+ "Sample_accession 296\n",
2043
+ "Collected_by 3\n",
2044
+ "Other_ID 824\n",
2045
+ "Date 265\n",
2046
+ "Dataset 8\n",
2047
+ "Store 76\n",
2048
+ "Brood 95\n",
2049
+ "Death_Date 52\n",
2050
+ "Cross_Type 0\n",
2051
+ "Stage 1\n",
2052
+ "Sex 3\n",
2053
+ "Unit_Type 6\n",
2054
+ "file_type 2\n",
2055
+ "CAM_Dupe 1\n",
2056
+ "dtype: int64"
2057
+ ]
2058
+ },
2059
+ "execution_count": 42,
2060
+ "metadata": {},
2061
+ "output_type": "execute_result"
2062
+ }
2063
+ ],
2064
+ "source": [
2065
+ "unique_samples.nunique()"
2066
+ ]
2067
+ },
2068
+ {
2069
+ "cell_type": "code",
2070
+ "execution_count": 43,
2071
+ "metadata": {},
2072
+ "outputs": [
2073
+ {
2074
+ "data": {
2075
+ "text/plain": [
2076
+ "file_type\n",
2077
+ "jpg 3535\n",
2078
+ "tif 18\n",
2079
+ "Name: count, dtype: int64"
2080
+ ]
2081
+ },
2082
+ "execution_count": 43,
2083
+ "metadata": {},
2084
+ "output_type": "execute_result"
2085
+ }
2086
+ ],
2087
+ "source": [
2088
+ "unique_samples.file_type.value_counts()"
2089
+ ]
2090
+ },
2091
+ {
2092
+ "cell_type": "markdown",
2093
+ "metadata": {},
2094
+ "source": [
2095
+ "Ah, well all raw images are indeed duplicated. Let's check if they're duplicated among themselves or duplicated to other file types (eg., jpg)."
2096
+ ]
2097
+ },
2098
+ {
2099
+ "cell_type": "code",
2100
+ "execution_count": 44,
2101
+ "metadata": {},
2102
+ "outputs": [
2103
+ {
2104
+ "name": "stdout",
2105
+ "output_type": "stream",
2106
+ "text": [
2107
+ "(5753, 23)\n"
2108
+ ]
2109
+ },
2110
+ {
2111
+ "data": {
2112
+ "text/plain": [
2113
+ "4944"
2114
+ ]
2115
+ },
2116
+ "execution_count": 44,
2117
+ "metadata": {},
2118
+ "output_type": "execute_result"
2119
+ }
2120
+ ],
2121
+ "source": [
2122
+ "print(duplicate_samples.loc[(duplicate_samples[\"View\"] != \"hindwing dorsal\") & (duplicate_samples[\"file_type\"] == \"raw\")].shape)\n",
2123
+ "duplicate_samples.loc[(duplicate_samples[\"View\"] != \"hindwing dorsal\") & (duplicate_samples[\"file_type\"] == \"raw\"), \"CAMID\"].nunique()"
2124
+ ]
2125
+ },
2126
+ {
2127
+ "cell_type": "markdown",
2128
+ "metadata": {},
2129
+ "source": [
2130
+ "Okay, so there are multiple raw images of the same sample. "
2131
+ ]
2132
+ },
2133
+ {
2134
+ "cell_type": "code",
2135
+ "execution_count": 45,
2136
+ "metadata": {},
2137
+ "outputs": [
2138
+ {
2139
+ "data": {
2140
+ "text/plain": [
2141
+ "View\n",
2142
+ "dorsal 4219\n",
2143
+ "Dorsal 1331\n",
2144
+ "forewing dorsal 203\n",
2145
+ "Name: count, dtype: int64"
2146
+ ]
2147
+ },
2148
+ "execution_count": 45,
2149
+ "metadata": {},
2150
+ "output_type": "execute_result"
2151
+ }
2152
+ ],
2153
+ "source": [
2154
+ "duplicate_raw = duplicate_samples.loc[(duplicate_samples[\"View\"] != \"hindwing dorsal\") & (duplicate_samples[\"file_type\"] == \"raw\")]\n",
2155
+ "duplicate_raw.View.value_counts()"
2156
+ ]
2157
+ },
2158
+ {
2159
+ "cell_type": "code",
2160
+ "execution_count": 46,
2161
+ "metadata": {},
2162
+ "outputs": [
2163
+ {
2164
+ "name": "stdout",
2165
+ "output_type": "stream",
2166
+ "text": [
2167
+ "raw_dupe\n",
2168
+ "False 4240\n",
2169
+ "True 1513\n",
2170
+ "Name: count, dtype: int64\n",
2171
+ "\n"
2172
+ ]
2173
+ },
2174
+ {
2175
+ "name": "stderr",
2176
+ "output_type": "stream",
2177
+ "text": [
2178
+ "/var/folders/nv/f0fq1p1n1_3b11x579py_0q80000gq/T/ipykernel_66533/3049709573.py:1: SettingWithCopyWarning: \n",
2179
+ "A value is trying to be set on a copy of a slice from a DataFrame.\n",
2180
+ "Try using .loc[row_indexer,col_indexer] = value instead\n",
2181
+ "\n",
2182
+ "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
2183
+ " duplicate_raw[\"raw_dupe\"] = duplicate_raw.duplicated(\"CAMID\", keep = False)\n"
2184
+ ]
2185
+ },
2186
+ {
2187
+ "data": {
2188
+ "text/plain": [
2189
+ "View\n",
2190
+ "dorsal 1159\n",
2191
+ "Dorsal 212\n",
2192
+ "forewing dorsal 142\n",
2193
+ "Name: count, dtype: int64"
2194
+ ]
2195
+ },
2196
+ "execution_count": 46,
2197
+ "metadata": {},
2198
+ "output_type": "execute_result"
2199
+ }
2200
+ ],
2201
+ "source": [
2202
+ "duplicate_raw[\"raw_dupe\"] = duplicate_raw.duplicated(\"CAMID\", keep = False)\n",
2203
+ "print(duplicate_raw[\"raw_dupe\"].value_counts())\n",
2204
+ "print()\n",
2205
+ "duplicate_raw.loc[duplicate_raw[\"raw_dupe\"], \"View\"].value_counts()"
2206
+ ]
2207
+ },
2208
+ {
2209
+ "cell_type": "markdown",
2210
+ "metadata": {},
2211
+ "source": [
2212
+ "There does not seem to be an easy method of filtering these other than just keeping the first instance of a particular `CAMID`.\n",
2213
+ "\n",
2214
+ "It is interesting that non of the Cross Types are unique. Is that just because we have the forewing/hindwing duplication?"
2215
+ ]
2216
+ },
2217
+ {
2218
+ "cell_type": "code",
2219
+ "execution_count": 47,
2220
+ "metadata": {},
2221
+ "outputs": [
2222
+ {
2223
+ "name": "stdout",
2224
+ "output_type": "stream",
2225
+ "text": [
2226
+ "(2572, 23)\n"
2227
+ ]
2228
+ },
2229
+ {
2230
+ "data": {
2231
+ "text/plain": [
2232
+ "820"
2233
+ ]
2234
+ },
2235
+ "execution_count": 47,
2236
+ "metadata": {},
2237
+ "output_type": "execute_result"
2238
+ }
2239
+ ],
2240
+ "source": [
2241
+ "print(duplicate_samples.loc[(duplicate_samples[\"View\"] != \"hindwing dorsal\") & (duplicate_samples[\"Cross_Type\"].notna())].shape)\n",
2242
+ "duplicate_samples.loc[(duplicate_samples[\"View\"] != \"hindwing dorsal\") & (duplicate_samples[\"Cross_Type\"].notna()), \"CAMID\"].nunique()"
2243
+ ]
2244
+ },
2245
+ {
2246
+ "cell_type": "markdown",
2247
+ "metadata": {},
2248
+ "source": [
2249
+ "There still seem to be 3 images for each specimen."
2250
+ ]
2251
+ },
2252
+ {
2253
+ "cell_type": "code",
2254
+ "execution_count": 48,
2255
+ "metadata": {},
2256
+ "outputs": [
2257
+ {
2258
+ "name": "stdout",
2259
+ "output_type": "stream",
2260
+ "text": [
2261
+ "cross_dupe\n",
2262
+ "True 2572\n",
2263
+ "Name: count, dtype: int64\n",
2264
+ "\n"
2265
+ ]
2266
+ },
2267
+ {
2268
+ "name": "stderr",
2269
+ "output_type": "stream",
2270
+ "text": [
2271
+ "/var/folders/nv/f0fq1p1n1_3b11x579py_0q80000gq/T/ipykernel_66533/2419376272.py:2: SettingWithCopyWarning: \n",
2272
+ "A value is trying to be set on a copy of a slice from a DataFrame.\n",
2273
+ "Try using .loc[row_indexer,col_indexer] = value instead\n",
2274
+ "\n",
2275
+ "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
2276
+ " duplicate_cross[\"cross_dupe\"] = duplicate_cross.duplicated(\"CAMID\", keep = False)\n"
2277
+ ]
2278
+ },
2279
+ {
2280
+ "data": {
2281
+ "text/plain": [
2282
+ "View\n",
2283
+ "dorsal 2322\n",
2284
+ "Dorsal 250\n",
2285
+ "Name: count, dtype: int64"
2286
+ ]
2287
+ },
2288
+ "execution_count": 48,
2289
+ "metadata": {},
2290
+ "output_type": "execute_result"
2291
+ }
2292
+ ],
2293
+ "source": [
2294
+ "duplicate_cross = duplicate_samples.loc[(duplicate_samples[\"View\"] != \"hindwing dorsal\") & (duplicate_samples[\"Cross_Type\"].notna())]\n",
2295
+ "duplicate_cross[\"cross_dupe\"] = duplicate_cross.duplicated(\"CAMID\", keep = False)\n",
2296
+ "print(duplicate_cross[\"cross_dupe\"].value_counts())\n",
2297
+ "print()\n",
2298
+ "duplicate_cross.View.value_counts()"
2299
+ ]
2300
+ },
2301
+ {
2302
+ "cell_type": "markdown",
2303
+ "metadata": {},
2304
+ "source": [
2305
+ "Yes, they are all duplicated."
2306
+ ]
2307
+ },
2308
+ {
2309
+ "cell_type": "code",
2310
+ "execution_count": 49,
2311
+ "metadata": {},
2312
+ "outputs": [
2313
+ {
2314
+ "data": {
2315
+ "text/plain": [
2316
+ "file_type\n",
2317
+ "jpg 1753\n",
2318
+ "raw 819\n",
2319
+ "Name: count, dtype: int64"
2320
+ ]
2321
+ },
2322
+ "execution_count": 49,
2323
+ "metadata": {},
2324
+ "output_type": "execute_result"
2325
+ }
2326
+ ],
2327
+ "source": [
2328
+ "duplicate_cross.file_type.value_counts()"
2329
+ ]
2330
+ },
2331
+ {
2332
+ "cell_type": "markdown",
2333
+ "metadata": {},
2334
+ "source": [
2335
+ "It seems there's one raw image for each sample (other than one) and then everything else is jpg. I wonder if this includes the `JPG(1)` values."
2336
+ ]
2337
+ },
2338
+ {
2339
+ "cell_type": "code",
2340
+ "execution_count": 50,
2341
+ "metadata": {},
2342
+ "outputs": [
2343
+ {
2344
+ "data": {
2345
+ "text/plain": [
2346
+ "0"
2347
+ ]
2348
+ },
2349
+ "execution_count": 50,
2350
+ "metadata": {},
2351
+ "output_type": "execute_result"
2352
+ }
2353
+ ],
2354
+ "source": [
2355
+ "count = 0\n",
2356
+ "for img_name in list(duplicate_cross.Image_name.unique()):\n",
2357
+ " if \"JPG(1)\" in img_name:\n",
2358
+ " count = count + 1\n",
2359
+ "count"
2360
+ ]
2361
+ },
2362
+ {
2363
+ "cell_type": "markdown",
2364
+ "metadata": {},
2365
+ "source": [
2366
+ "No, that's not the issue."
2367
+ ]
2368
+ },
2369
+ {
2370
+ "cell_type": "code",
2371
+ "execution_count": 51,
2372
+ "metadata": {},
2373
+ "outputs": [
2374
+ {
2375
+ "data": {
2376
+ "text/plain": [
2377
+ "0"
2378
+ ]
2379
+ },
2380
+ "execution_count": 51,
2381
+ "metadata": {},
2382
+ "output_type": "execute_result"
2383
+ }
2384
+ ],
2385
+ "source": [
2386
+ "count = 0\n",
2387
+ "for img_name in list(duplicate_samples.Image_name.unique()):\n",
2388
+ " if \"JPG(1)\" in img_name:\n",
2389
+ " count = count + 1\n",
2390
+ "count"
2391
+ ]
2392
+ },
2393
+ {
2394
+ "cell_type": "code",
2395
+ "execution_count": 52,
2396
+ "metadata": {},
2397
+ "outputs": [
2398
+ {
2399
+ "data": {
2400
+ "text/plain": [
2401
+ "0"
2402
+ ]
2403
+ },
2404
+ "execution_count": 52,
2405
+ "metadata": {},
2406
+ "output_type": "execute_result"
2407
+ }
2408
+ ],
2409
+ "source": [
2410
+ "count = 0\n",
2411
+ "for img_name in list(df_img_dorsal.Image_name.unique()):\n",
2412
+ " if \"JPG(1)\" in img_name:\n",
2413
+ " count = count + 1\n",
2414
+ "count"
2415
+ ]
2416
+ },
2417
+ {
2418
+ "cell_type": "code",
2419
+ "execution_count": 53,
2420
+ "metadata": {},
2421
+ "outputs": [
2422
+ {
2423
+ "data": {
2424
+ "text/plain": [
2425
+ "1"
2426
+ ]
2427
+ },
2428
+ "execution_count": 53,
2429
+ "metadata": {},
2430
+ "output_type": "execute_result"
2431
+ }
2432
+ ],
2433
+ "source": [
2434
+ "count = 0\n",
2435
+ "for img_name in list(df_img.Image_name.unique()):\n",
2436
+ " if \"JPG(1)\" in img_name:\n",
2437
+ " count = count + 1\n",
2438
+ "count"
2439
+ ]
2440
+ },
2441
+ {
2442
+ "cell_type": "markdown",
2443
+ "metadata": {},
2444
+ "source": [
2445
+ "There's only one instance of this, and it's not a dorsal image, so that's not part of the issue."
2446
+ ]
2447
+ },
2448
+ {
2449
+ "cell_type": "markdown",
2450
+ "metadata": {},
2451
+ "source": [
2452
+ "Let's save all the dorsal images as another CSV (with the duplicate `CAMID` indicator)."
2453
+ ]
2454
+ },
2455
+ {
2456
+ "cell_type": "code",
2457
+ "execution_count": 54,
2458
+ "metadata": {},
2459
+ "outputs": [],
2460
+ "source": [
2461
+ "df_img_dorsal.to_csv(\"../Jiggins_Zenodo_dorsal_Img_Master.csv\", index = False)"
2462
+ ]
2463
+ },
2464
+ {
2465
+ "cell_type": "code",
2466
+ "execution_count": null,
2467
+ "metadata": {},
2468
+ "outputs": [],
2469
+ "source": []
2470
+ }
2471
+ ],
2472
+ "metadata": {
2473
+ "kernelspec": {
2474
+ "display_name": "std",
2475
+ "language": "python",
2476
+ "name": "python3"
2477
+ },
2478
+ "language_info": {
2479
+ "codemirror_mode": {
2480
+ "name": "ipython",
2481
+ "version": 3
2482
+ },
2483
+ "file_extension": ".py",
2484
+ "mimetype": "text/x-python",
2485
+ "name": "python",
2486
+ "nbconvert_exporter": "python",
2487
+ "pygments_lexer": "ipython3",
2488
+ "version": "3.11.3"
2489
+ },
2490
+ "orig_nbformat": 4
2491
+ },
2492
+ "nbformat": 4,
2493
+ "nbformat_minor": 2
2494
+ }
notebooks/standardize_taxa.ipynb ADDED
@@ -0,0 +1,1464 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "import pandas as pd"
10
+ ]
11
+ },
12
+ {
13
+ "cell_type": "code",
14
+ "execution_count": 2,
15
+ "metadata": {},
16
+ "outputs": [],
17
+ "source": [
18
+ "df = pd.read_csv(\"../Jiggins_Zenodo_Img_Master.csv\", low_memory=False)"
19
+ ]
20
+ },
21
+ {
22
+ "cell_type": "code",
23
+ "execution_count": 3,
24
+ "metadata": {},
25
+ "outputs": [
26
+ {
27
+ "data": {
28
+ "text/plain": [
29
+ "CAMID 12586\n",
30
+ "X 49359\n",
31
+ "Image_name 37821\n",
32
+ "View 10\n",
33
+ "zenodo_name 36\n",
34
+ "zenodo_link 32\n",
35
+ "Sequence 11301\n",
36
+ "Taxonomic_Name 363\n",
37
+ "Locality 645\n",
38
+ "Sample_accession 1571\n",
39
+ "Collected_by 12\n",
40
+ "Other_ID 3088\n",
41
+ "Date 810\n",
42
+ "Dataset 8\n",
43
+ "Store 142\n",
44
+ "Brood 226\n",
45
+ "Death_Date 82\n",
46
+ "Cross_Type 30\n",
47
+ "Stage 1\n",
48
+ "Sex 3\n",
49
+ "Unit_Type 6\n",
50
+ "file_type 3\n",
51
+ "dtype: int64"
52
+ ]
53
+ },
54
+ "execution_count": 3,
55
+ "metadata": {},
56
+ "output_type": "execute_result"
57
+ }
58
+ ],
59
+ "source": [
60
+ "df.nunique()"
61
+ ]
62
+ },
63
+ {
64
+ "cell_type": "code",
65
+ "execution_count": 4,
66
+ "metadata": {},
67
+ "outputs": [
68
+ {
69
+ "data": {
70
+ "text/plain": [
71
+ "file_type\n",
72
+ "jpg 37072\n",
73
+ "raw 12226\n",
74
+ "tif 61\n",
75
+ "Name: count, dtype: int64"
76
+ ]
77
+ },
78
+ "execution_count": 4,
79
+ "metadata": {},
80
+ "output_type": "execute_result"
81
+ }
82
+ ],
83
+ "source": [
84
+ "df.file_type.value_counts()"
85
+ ]
86
+ },
87
+ {
88
+ "cell_type": "code",
89
+ "execution_count": 5,
90
+ "metadata": {},
91
+ "outputs": [
92
+ {
93
+ "data": {
94
+ "text/plain": [
95
+ "View\n",
96
+ "dorsal 15128\n",
97
+ "ventral 13424\n",
98
+ "Dorsal 8360\n",
99
+ "Ventral 8090\n",
100
+ "ventral 1644\n",
101
+ "forewing dorsal 406\n",
102
+ "hindwing dorsal 406\n",
103
+ "forewing ventral 406\n",
104
+ "hindwing ventral 406\n",
105
+ "Dorsal and Ventral 18\n",
106
+ "Name: count, dtype: int64"
107
+ ]
108
+ },
109
+ "execution_count": 5,
110
+ "metadata": {},
111
+ "output_type": "execute_result"
112
+ }
113
+ ],
114
+ "source": [
115
+ "df.View.value_counts()"
116
+ ]
117
+ },
118
+ {
119
+ "cell_type": "markdown",
120
+ "metadata": {},
121
+ "source": [
122
+ "Not great that `ventral` gets listed twice as lowercase and _again_ as `Ventral`.\n",
123
+ "\n",
124
+ "### Standardize `View` Column\n",
125
+ "Let's standardize `View` so that there isn't a discrepancy based on case."
126
+ ]
127
+ },
128
+ {
129
+ "cell_type": "code",
130
+ "execution_count": 6,
131
+ "metadata": {},
132
+ "outputs": [
133
+ {
134
+ "data": {
135
+ "text/plain": [
136
+ "View\n",
137
+ "dorsal 23488\n",
138
+ "ventral 21514\n",
139
+ "ventral 1644\n",
140
+ "forewing dorsal 406\n",
141
+ "hindwing dorsal 406\n",
142
+ "forewing ventral 406\n",
143
+ "hindwing ventral 406\n",
144
+ "dorsal and ventral 18\n",
145
+ "Name: count, dtype: int64"
146
+ ]
147
+ },
148
+ "execution_count": 6,
149
+ "metadata": {},
150
+ "output_type": "execute_result"
151
+ }
152
+ ],
153
+ "source": [
154
+ "df[\"View\"] = df.View.str.lower()\n",
155
+ "df.View.value_counts()"
156
+ ]
157
+ },
158
+ {
159
+ "cell_type": "code",
160
+ "execution_count": 7,
161
+ "metadata": {},
162
+ "outputs": [
163
+ {
164
+ "name": "stdout",
165
+ "output_type": "stream",
166
+ "text": [
167
+ "['dorsal' 'ventral' nan 'dorsal and ventral' 'ventral ' 'forewing dorsal'\n",
168
+ " 'hindwing dorsal' 'forewing ventral' 'hindwing ventral']\n"
169
+ ]
170
+ }
171
+ ],
172
+ "source": [
173
+ "print(df.View.unique())"
174
+ ]
175
+ },
176
+ {
177
+ "cell_type": "markdown",
178
+ "metadata": {},
179
+ "source": [
180
+ "Yes, one has a space after it, so we'll replace that."
181
+ ]
182
+ },
183
+ {
184
+ "cell_type": "code",
185
+ "execution_count": 8,
186
+ "metadata": {},
187
+ "outputs": [
188
+ {
189
+ "data": {
190
+ "text/plain": [
191
+ "View\n",
192
+ "dorsal 23488\n",
193
+ "ventral 23158\n",
194
+ "forewing dorsal 406\n",
195
+ "hindwing dorsal 406\n",
196
+ "forewing ventral 406\n",
197
+ "hindwing ventral 406\n",
198
+ "dorsal and ventral 18\n",
199
+ "Name: count, dtype: int64"
200
+ ]
201
+ },
202
+ "execution_count": 8,
203
+ "metadata": {},
204
+ "output_type": "execute_result"
205
+ }
206
+ ],
207
+ "source": [
208
+ "df.loc[df[\"View\"] == \"ventral \", \"View\"] = \"ventral\"\n",
209
+ "df.View.value_counts() "
210
+ ]
211
+ },
212
+ {
213
+ "cell_type": "markdown",
214
+ "metadata": {},
215
+ "source": [
216
+ "### Add Record Number Column\n",
217
+ "We'll add a `record_number` column for easier matching to the license/citation file."
218
+ ]
219
+ },
220
+ {
221
+ "cell_type": "code",
222
+ "execution_count": 9,
223
+ "metadata": {},
224
+ "outputs": [],
225
+ "source": [
226
+ "def get_record_number(url):\n",
227
+ " num = url.split(sep = \"/\")[-1]\n",
228
+ " return num"
229
+ ]
230
+ },
231
+ {
232
+ "cell_type": "code",
233
+ "execution_count": 10,
234
+ "metadata": {},
235
+ "outputs": [
236
+ {
237
+ "data": {
238
+ "text/plain": [
239
+ "32"
240
+ ]
241
+ },
242
+ "execution_count": 10,
243
+ "metadata": {},
244
+ "output_type": "execute_result"
245
+ }
246
+ ],
247
+ "source": [
248
+ "df[\"record_number\"] = df.zenodo_link.apply(get_record_number)\n",
249
+ "df.record_number.nunique()"
250
+ ]
251
+ },
252
+ {
253
+ "cell_type": "markdown",
254
+ "metadata": {},
255
+ "source": [
256
+ "We have 32 unique records represented in the full dataset. When we reduce down to just the Heliconius images, this will probably be less."
257
+ ]
258
+ },
259
+ {
260
+ "cell_type": "markdown",
261
+ "metadata": {},
262
+ "source": [
263
+ "### Add `species` and `subspecies` Columns\n",
264
+ "This will make some analysis easier and allow for easy viewing on the [Data Dashboard](https://huggingface.co/spaces/imageomics/dashboard-prototype)."
265
+ ]
266
+ },
267
+ {
268
+ "cell_type": "code",
269
+ "execution_count": 11,
270
+ "metadata": {},
271
+ "outputs": [],
272
+ "source": [
273
+ "def get_species(taxa_name):\n",
274
+ " if type(taxa_name) != float: #taxa name not null\n",
275
+ " species = taxa_name.split(sep = \" ssp\")[0]\n",
276
+ " return species\n",
277
+ " else:\n",
278
+ " return taxa_name"
279
+ ]
280
+ },
281
+ {
282
+ "cell_type": "code",
283
+ "execution_count": 12,
284
+ "metadata": {},
285
+ "outputs": [],
286
+ "source": [
287
+ "def get_subspecies(taxa_name):\n",
288
+ " if type(taxa_name) != float:\n",
289
+ " if \"ssp.\" in taxa_name:\n",
290
+ " subspecies = taxa_name.split(sep = \"ssp. \")[1]\n",
291
+ " elif \"ssp \" in taxa_name:\n",
292
+ " subspecies = taxa_name.split(sep = \"ssp \")[1]\n",
293
+ " else:\n",
294
+ " subspecies = None\n",
295
+ " else:\n",
296
+ " subspecies = None\n",
297
+ " return subspecies"
298
+ ]
299
+ },
300
+ {
301
+ "cell_type": "code",
302
+ "execution_count": 13,
303
+ "metadata": {},
304
+ "outputs": [
305
+ {
306
+ "data": {
307
+ "text/plain": [
308
+ "246"
309
+ ]
310
+ },
311
+ "execution_count": 13,
312
+ "metadata": {},
313
+ "output_type": "execute_result"
314
+ }
315
+ ],
316
+ "source": [
317
+ "df[\"species\"] = df.Taxonomic_Name.apply(get_species)\n",
318
+ "df.species.nunique()"
319
+ ]
320
+ },
321
+ {
322
+ "cell_type": "code",
323
+ "execution_count": 14,
324
+ "metadata": {},
325
+ "outputs": [
326
+ {
327
+ "data": {
328
+ "text/plain": [
329
+ "139"
330
+ ]
331
+ },
332
+ "execution_count": 14,
333
+ "metadata": {},
334
+ "output_type": "execute_result"
335
+ }
336
+ ],
337
+ "source": [
338
+ "df[\"subspecies\"] = df.Taxonomic_Name.apply(get_subspecies)\n",
339
+ "df.subspecies.nunique()"
340
+ ]
341
+ },
342
+ {
343
+ "cell_type": "markdown",
344
+ "metadata": {},
345
+ "source": [
346
+ "Cross Types are labeled differently:\n",
347
+ "They are all abbreviations, we have `malleti (mal), plesseni (ple), notabilis (not), lativitta (lat)`, and Neil would guess that `latRo` refers to lativitta with a rounded apical band (e.g., a phenotypic variant of lativitta), but he couldn't say for sure without some more digging, so that will have to stay as-is. We will leave the `Test cross...` ones, but there is not much more to do with them."
348
+ ]
349
+ },
350
+ {
351
+ "cell_type": "code",
352
+ "execution_count": 15,
353
+ "metadata": {},
354
+ "outputs": [
355
+ {
356
+ "data": {
357
+ "text/plain": [
358
+ "array(['mal', 'mal x ple', 'ple', 'ple x mal', 'latRo x not',\n",
359
+ " '(latRo x not) x not', '(mal x ple) x mal', '(mal x ple) x ple',\n",
360
+ " 'ple x (mal x ple)', '(ple x mal) x (mal x ple)', 'lat x not',\n",
361
+ " '(ple x mal) x ple', '(mal x ple) x (mal x ple)',\n",
362
+ " '(ple x mal) x mal', '(ple x mal) x (ple x mal)',\n",
363
+ " '(mal x ple) x (ple x mal)', 'hybrid', 'mal x (ple x mal)',\n",
364
+ " '(lat x not) x lat', '(lat x not) x not', 'Ac heterozygote',\n",
365
+ " 'ple x (ple x mal)', '2 banded', 'lat',\n",
366
+ " 'Test cross (2 banded F2 x 2 banded F2)',\n",
367
+ " 'Test cross (4 spots x 2 banded)', 'Test cross (N heterozygozity)',\n",
368
+ " 'Test cross (short HW bar)', 'Test cross (4 spots x 4 spots)',\n",
369
+ " 'Test cross (N heterozygocity - NBNN x mal - thin)'], dtype=object)"
370
+ ]
371
+ },
372
+ "execution_count": 15,
373
+ "metadata": {},
374
+ "output_type": "execute_result"
375
+ }
376
+ ],
377
+ "source": [
378
+ "df.Cross_Type.dropna().unique()"
379
+ ]
380
+ },
381
+ {
382
+ "cell_type": "code",
383
+ "execution_count": 16,
384
+ "metadata": {},
385
+ "outputs": [],
386
+ "source": [
387
+ "def clean_cross_types(cross_type):\n",
388
+ " if type(cross_type) != float:\n",
389
+ " cross_type = cross_type.replace(\"mal\", \"malleti\")\n",
390
+ " cross_type = cross_type.replace(\"ple\", \"plesseni\")\n",
391
+ " cross_type = cross_type.replace(\"not\", \"notabilis\")\n",
392
+ " if \"latRo\" not in cross_type:\n",
393
+ " #latRo does not cross with lativitta, so only apply when latRo isn't present\n",
394
+ " cross_type = cross_type.replace(\"lat\", \"lativitta\")\n",
395
+ " return cross_type"
396
+ ]
397
+ },
398
+ {
399
+ "cell_type": "code",
400
+ "execution_count": 17,
401
+ "metadata": {},
402
+ "outputs": [],
403
+ "source": [
404
+ "df[\"Cross_Type\"] = df[\"Cross_Type\"].apply(clean_cross_types)"
405
+ ]
406
+ },
407
+ {
408
+ "cell_type": "markdown",
409
+ "metadata": {},
410
+ "source": [
411
+ "Now we can fill these cross types in for the `subspecies` column (all Cross Types are just labeled to the spceies level in `Taxonomic_Name`, so they did not get processed previously)."
412
+ ]
413
+ },
414
+ {
415
+ "cell_type": "code",
416
+ "execution_count": 18,
417
+ "metadata": {},
418
+ "outputs": [
419
+ {
420
+ "data": {
421
+ "text/plain": [
422
+ "156"
423
+ ]
424
+ },
425
+ "execution_count": 18,
426
+ "metadata": {},
427
+ "output_type": "execute_result"
428
+ }
429
+ ],
430
+ "source": [
431
+ "cross_type_subspecies = [ct for ct in list(df.Cross_Type.dropna().unique()) if \"Test\" not in ct and \"banded\" not in ct]\n",
432
+ "cross_type_subspecies.remove(\"hybrid\")\n",
433
+ "cross_type_subspecies.remove(\"Ac heterozygote\")\n",
434
+ "\n",
435
+ "for ct in cross_type_subspecies:\n",
436
+ " df.loc[df[\"Cross_Type\"] == ct, \"subspecies\"] = ct\n",
437
+ "\n",
438
+ "df.subspecies.nunique()\n"
439
+ ]
440
+ },
441
+ {
442
+ "cell_type": "code",
443
+ "execution_count": 19,
444
+ "metadata": {},
445
+ "outputs": [
446
+ {
447
+ "data": {
448
+ "text/plain": [
449
+ "21"
450
+ ]
451
+ },
452
+ "execution_count": 19,
453
+ "metadata": {},
454
+ "output_type": "execute_result"
455
+ }
456
+ ],
457
+ "source": [
458
+ "len(cross_type_subspecies)"
459
+ ]
460
+ },
461
+ {
462
+ "cell_type": "code",
463
+ "execution_count": 20,
464
+ "metadata": {},
465
+ "outputs": [
466
+ {
467
+ "data": {
468
+ "text/plain": [
469
+ "subspecies\n",
470
+ "(malleti x plesseni) x malleti 1204\n",
471
+ "plesseni x (malleti x plesseni) 600\n",
472
+ "malleti x (plesseni x malleti) 370\n",
473
+ "(plesseni x malleti) x plesseni 363\n",
474
+ "(plesseni x malleti) x (malleti x plesseni) 354\n",
475
+ "(plesseni x malleti) x (plesseni x malleti) 286\n",
476
+ "(malleti x plesseni) x plesseni 278\n",
477
+ "plesseni x malleti 234\n",
478
+ "malleti x plesseni 192\n",
479
+ "lativitta x notabilis 136\n",
480
+ "(lativitta x notabilis) x lativitta 110\n",
481
+ "plesseni x (plesseni x malleti) 106\n",
482
+ "(lativitta x notabilis) x notabilis 106\n",
483
+ "(malleti x plesseni) x (malleti x plesseni) 98\n",
484
+ "(plesseni x malleti) x malleti 80\n",
485
+ "(malleti x plesseni) x (plesseni x malleti) 56\n",
486
+ "malleti 28\n",
487
+ "plesseni 28\n",
488
+ "(latRo x notabilis) x notabilis 16\n",
489
+ "latRo x notabilis 4\n",
490
+ "lativitta 4\n",
491
+ "Name: count, dtype: int64"
492
+ ]
493
+ },
494
+ "execution_count": 20,
495
+ "metadata": {},
496
+ "output_type": "execute_result"
497
+ }
498
+ ],
499
+ "source": [
500
+ "df.loc[df[\"Cross_Type\"].notna(), \"subspecies\"].value_counts()"
501
+ ]
502
+ },
503
+ {
504
+ "cell_type": "code",
505
+ "execution_count": 21,
506
+ "metadata": {},
507
+ "outputs": [
508
+ {
509
+ "name": "stdout",
510
+ "output_type": "stream",
511
+ "text": [
512
+ "4\n"
513
+ ]
514
+ },
515
+ {
516
+ "data": {
517
+ "text/plain": [
518
+ "['malleti', 'plesseni', 'plesseni x malleti', 'lativitta']"
519
+ ]
520
+ },
521
+ "execution_count": 21,
522
+ "metadata": {},
523
+ "output_type": "execute_result"
524
+ }
525
+ ],
526
+ "source": [
527
+ "already_present_subspecies = []\n",
528
+ "\n",
529
+ "for subspecies in list(df.loc[df[\"Cross_Type\"].notna(), \"subspecies\"].dropna().unique()):\n",
530
+ " if subspecies in list(df.loc[~df[\"Cross_Type\"].notna(), \"subspecies\"].dropna().unique()):\n",
531
+ " already_present_subspecies.append(subspecies)\n",
532
+ "\n",
533
+ "print(len(already_present_subspecies))\n",
534
+ "already_present_subspecies"
535
+ ]
536
+ },
537
+ {
538
+ "cell_type": "markdown",
539
+ "metadata": {},
540
+ "source": [
541
+ "Perfect, this adds 17 more subspecies (`lativitta`, `plessani`, `maletti`, and `plesseni x malleti` were already represented). Note, this is based on _exact_ duplicates. `notabilis x lativitta` is also already in the dataset, but the order (where the cross types are concerned) general goes `maternal x paternal`."
542
+ ]
543
+ },
544
+ {
545
+ "cell_type": "code",
546
+ "execution_count": 22,
547
+ "metadata": {},
548
+ "outputs": [
549
+ {
550
+ "data": {
551
+ "text/html": [
552
+ "<div>\n",
553
+ "<style scoped>\n",
554
+ " .dataframe tbody tr th:only-of-type {\n",
555
+ " vertical-align: middle;\n",
556
+ " }\n",
557
+ "\n",
558
+ " .dataframe tbody tr th {\n",
559
+ " vertical-align: top;\n",
560
+ " }\n",
561
+ "\n",
562
+ " .dataframe thead th {\n",
563
+ " text-align: right;\n",
564
+ " }\n",
565
+ "</style>\n",
566
+ "<table border=\"1\" class=\"dataframe\">\n",
567
+ " <thead>\n",
568
+ " <tr style=\"text-align: right;\">\n",
569
+ " <th></th>\n",
570
+ " <th>CAMID</th>\n",
571
+ " <th>X</th>\n",
572
+ " <th>Image_name</th>\n",
573
+ " <th>View</th>\n",
574
+ " <th>zenodo_name</th>\n",
575
+ " <th>zenodo_link</th>\n",
576
+ " <th>Sequence</th>\n",
577
+ " <th>Taxonomic_Name</th>\n",
578
+ " <th>Locality</th>\n",
579
+ " <th>Sample_accession</th>\n",
580
+ " <th>...</th>\n",
581
+ " <th>Brood</th>\n",
582
+ " <th>Death_Date</th>\n",
583
+ " <th>Cross_Type</th>\n",
584
+ " <th>Stage</th>\n",
585
+ " <th>Sex</th>\n",
586
+ " <th>Unit_Type</th>\n",
587
+ " <th>file_type</th>\n",
588
+ " <th>record_number</th>\n",
589
+ " <th>species</th>\n",
590
+ " <th>subspecies</th>\n",
591
+ " </tr>\n",
592
+ " </thead>\n",
593
+ " <tbody>\n",
594
+ " <tr>\n",
595
+ " <th>1986</th>\n",
596
+ " <td>19N1989</td>\n",
597
+ " <td>21369</td>\n",
598
+ " <td>19N1989_v.JPG</td>\n",
599
+ " <td>ventral</td>\n",
600
+ " <td>0.sheffield.ps.nn.ikiam.batch2.csv</td>\n",
601
+ " <td>https://zenodo.org/record/4288311</td>\n",
602
+ " <td>1,989</td>\n",
603
+ " <td>Heliconius melpomene ssp. malleti</td>\n",
604
+ " <td>Ikiam Mariposario</td>\n",
605
+ " <td>NaN</td>\n",
606
+ " <td>...</td>\n",
607
+ " <td>IKIAM.P44</td>\n",
608
+ " <td>NaN</td>\n",
609
+ " <td>NaN</td>\n",
610
+ " <td>NaN</td>\n",
611
+ " <td>Male</td>\n",
612
+ " <td>reared</td>\n",
613
+ " <td>jpg</td>\n",
614
+ " <td>4288311</td>\n",
615
+ " <td>Heliconius melpomene</td>\n",
616
+ " <td>malleti</td>\n",
617
+ " </tr>\n",
618
+ " <tr>\n",
619
+ " <th>45062</th>\n",
620
+ " <td>CAM044423</td>\n",
621
+ " <td>34391</td>\n",
622
+ " <td>CAM044423_d.CR2</td>\n",
623
+ " <td>dorsal</td>\n",
624
+ " <td>batch2.Peru.image.names.Zenodo.csv</td>\n",
625
+ " <td>https://zenodo.org/record/4287444</td>\n",
626
+ " <td>44,423</td>\n",
627
+ " <td>Taygetis cleopatra</td>\n",
628
+ " <td>B6old6</td>\n",
629
+ " <td>NaN</td>\n",
630
+ " <td>...</td>\n",
631
+ " <td>NaN</td>\n",
632
+ " <td>NaN</td>\n",
633
+ " <td>NaN</td>\n",
634
+ " <td>NaN</td>\n",
635
+ " <td>NaN</td>\n",
636
+ " <td>NaN</td>\n",
637
+ " <td>raw</td>\n",
638
+ " <td>4287444</td>\n",
639
+ " <td>Taygetis cleopatra</td>\n",
640
+ " <td>None</td>\n",
641
+ " </tr>\n",
642
+ " <tr>\n",
643
+ " <th>48534</th>\n",
644
+ " <td>E23</td>\n",
645
+ " <td>37555</td>\n",
646
+ " <td>E23_d.CR2</td>\n",
647
+ " <td>dorsal</td>\n",
648
+ " <td>Anniina.Matilla.Field.Caught.E.csv</td>\n",
649
+ " <td>https://zenodo.org/record/2554218</td>\n",
650
+ " <td>NaN</td>\n",
651
+ " <td>NaN</td>\n",
652
+ " <td>NaN</td>\n",
653
+ " <td>NaN</td>\n",
654
+ " <td>...</td>\n",
655
+ " <td>NaN</td>\n",
656
+ " <td>NaN</td>\n",
657
+ " <td>NaN</td>\n",
658
+ " <td>NaN</td>\n",
659
+ " <td>NaN</td>\n",
660
+ " <td>NaN</td>\n",
661
+ " <td>raw</td>\n",
662
+ " <td>2554218</td>\n",
663
+ " <td>NaN</td>\n",
664
+ " <td>None</td>\n",
665
+ " </tr>\n",
666
+ " <tr>\n",
667
+ " <th>45206</th>\n",
668
+ " <td>CAM044445</td>\n",
669
+ " <td>37132</td>\n",
670
+ " <td>CAM044445_d.JPG</td>\n",
671
+ " <td>dorsal</td>\n",
672
+ " <td>batch3.Peru.image.names.Zenodo.csv</td>\n",
673
+ " <td>https://zenodo.org/record/4288250</td>\n",
674
+ " <td>44,445</td>\n",
675
+ " <td>Taygetis cleopatra</td>\n",
676
+ " <td>B4old2</td>\n",
677
+ " <td>NaN</td>\n",
678
+ " <td>...</td>\n",
679
+ " <td>NaN</td>\n",
680
+ " <td>NaN</td>\n",
681
+ " <td>NaN</td>\n",
682
+ " <td>NaN</td>\n",
683
+ " <td>NaN</td>\n",
684
+ " <td>NaN</td>\n",
685
+ " <td>jpg</td>\n",
686
+ " <td>4288250</td>\n",
687
+ " <td>Taygetis cleopatra</td>\n",
688
+ " <td>None</td>\n",
689
+ " </tr>\n",
690
+ " <tr>\n",
691
+ " <th>12212</th>\n",
692
+ " <td>CAM010238</td>\n",
693
+ " <td>23307</td>\n",
694
+ " <td>10238v.jpg</td>\n",
695
+ " <td>ventral</td>\n",
696
+ " <td>Heliconius_wing_old_photos_2001_2019_part1.csv</td>\n",
697
+ " <td>https://zenodo.org/record/2552371</td>\n",
698
+ " <td>10,238</td>\n",
699
+ " <td>Heliconius sp.</td>\n",
700
+ " <td>NaN</td>\n",
701
+ " <td>NaN</td>\n",
702
+ " <td>...</td>\n",
703
+ " <td>B043</td>\n",
704
+ " <td>NaN</td>\n",
705
+ " <td>NaN</td>\n",
706
+ " <td>NaN</td>\n",
707
+ " <td>Female</td>\n",
708
+ " <td>reared</td>\n",
709
+ " <td>jpg</td>\n",
710
+ " <td>2552371</td>\n",
711
+ " <td>Heliconius sp.</td>\n",
712
+ " <td>None</td>\n",
713
+ " </tr>\n",
714
+ " <tr>\n",
715
+ " <th>39059</th>\n",
716
+ " <td>CAM043418</td>\n",
717
+ " <td>30654</td>\n",
718
+ " <td>CAM043418_v.JPG</td>\n",
719
+ " <td>ventral</td>\n",
720
+ " <td>batch1.Peru.image.names.Zenodo.csv</td>\n",
721
+ " <td>https://zenodo.org/record/3569598</td>\n",
722
+ " <td>43,418</td>\n",
723
+ " <td>Archaeoprepona licomedes</td>\n",
724
+ " <td>B6rec6</td>\n",
725
+ " <td>NaN</td>\n",
726
+ " <td>...</td>\n",
727
+ " <td>NaN</td>\n",
728
+ " <td>NaN</td>\n",
729
+ " <td>NaN</td>\n",
730
+ " <td>NaN</td>\n",
731
+ " <td>NaN</td>\n",
732
+ " <td>NaN</td>\n",
733
+ " <td>jpg</td>\n",
734
+ " <td>3569598</td>\n",
735
+ " <td>Archaeoprepona licomedes</td>\n",
736
+ " <td>None</td>\n",
737
+ " </tr>\n",
738
+ " <tr>\n",
739
+ " <th>38163</th>\n",
740
+ " <td>CAM043170</td>\n",
741
+ " <td>29755</td>\n",
742
+ " <td>CAM043170_d.CR2</td>\n",
743
+ " <td>dorsal</td>\n",
744
+ " <td>batch1.Peru.image.names.Zenodo.csv</td>\n",
745
+ " <td>https://zenodo.org/record/3569598</td>\n",
746
+ " <td>43,170</td>\n",
747
+ " <td>Adelpha mesentina</td>\n",
748
+ " <td>F3rec2</td>\n",
749
+ " <td>NaN</td>\n",
750
+ " <td>...</td>\n",
751
+ " <td>NaN</td>\n",
752
+ " <td>NaN</td>\n",
753
+ " <td>NaN</td>\n",
754
+ " <td>NaN</td>\n",
755
+ " <td>NaN</td>\n",
756
+ " <td>NaN</td>\n",
757
+ " <td>raw</td>\n",
758
+ " <td>3569598</td>\n",
759
+ " <td>Adelpha mesentina</td>\n",
760
+ " <td>None</td>\n",
761
+ " </tr>\n",
762
+ " </tbody>\n",
763
+ "</table>\n",
764
+ "<p>7 rows × 25 columns</p>\n",
765
+ "</div>"
766
+ ],
767
+ "text/plain": [
768
+ " CAMID X Image_name View \\\n",
769
+ "1986 19N1989 21369 19N1989_v.JPG ventral \n",
770
+ "45062 CAM044423 34391 CAM044423_d.CR2 dorsal \n",
771
+ "48534 E23 37555 E23_d.CR2 dorsal \n",
772
+ "45206 CAM044445 37132 CAM044445_d.JPG dorsal \n",
773
+ "12212 CAM010238 23307 10238v.jpg ventral \n",
774
+ "39059 CAM043418 30654 CAM043418_v.JPG ventral \n",
775
+ "38163 CAM043170 29755 CAM043170_d.CR2 dorsal \n",
776
+ "\n",
777
+ " zenodo_name \\\n",
778
+ "1986 0.sheffield.ps.nn.ikiam.batch2.csv \n",
779
+ "45062 batch2.Peru.image.names.Zenodo.csv \n",
780
+ "48534 Anniina.Matilla.Field.Caught.E.csv \n",
781
+ "45206 batch3.Peru.image.names.Zenodo.csv \n",
782
+ "12212 Heliconius_wing_old_photos_2001_2019_part1.csv \n",
783
+ "39059 batch1.Peru.image.names.Zenodo.csv \n",
784
+ "38163 batch1.Peru.image.names.Zenodo.csv \n",
785
+ "\n",
786
+ " zenodo_link Sequence \\\n",
787
+ "1986 https://zenodo.org/record/4288311 1,989 \n",
788
+ "45062 https://zenodo.org/record/4287444 44,423 \n",
789
+ "48534 https://zenodo.org/record/2554218 NaN \n",
790
+ "45206 https://zenodo.org/record/4288250 44,445 \n",
791
+ "12212 https://zenodo.org/record/2552371 10,238 \n",
792
+ "39059 https://zenodo.org/record/3569598 43,418 \n",
793
+ "38163 https://zenodo.org/record/3569598 43,170 \n",
794
+ "\n",
795
+ " Taxonomic_Name Locality Sample_accession \\\n",
796
+ "1986 Heliconius melpomene ssp. malleti Ikiam Mariposario NaN \n",
797
+ "45062 Taygetis cleopatra B6old6 NaN \n",
798
+ "48534 NaN NaN NaN \n",
799
+ "45206 Taygetis cleopatra B4old2 NaN \n",
800
+ "12212 Heliconius sp. NaN NaN \n",
801
+ "39059 Archaeoprepona licomedes B6rec6 NaN \n",
802
+ "38163 Adelpha mesentina F3rec2 NaN \n",
803
+ "\n",
804
+ " ... Brood Death_Date Cross_Type Stage Sex Unit_Type file_type \\\n",
805
+ "1986 ... IKIAM.P44 NaN NaN NaN Male reared jpg \n",
806
+ "45062 ... NaN NaN NaN NaN NaN NaN raw \n",
807
+ "48534 ... NaN NaN NaN NaN NaN NaN raw \n",
808
+ "45206 ... NaN NaN NaN NaN NaN NaN jpg \n",
809
+ "12212 ... B043 NaN NaN NaN Female reared jpg \n",
810
+ "39059 ... NaN NaN NaN NaN NaN NaN jpg \n",
811
+ "38163 ... NaN NaN NaN NaN NaN NaN raw \n",
812
+ "\n",
813
+ " record_number species subspecies \n",
814
+ "1986 4288311 Heliconius melpomene malleti \n",
815
+ "45062 4287444 Taygetis cleopatra None \n",
816
+ "48534 2554218 NaN None \n",
817
+ "45206 4288250 Taygetis cleopatra None \n",
818
+ "12212 2552371 Heliconius sp. None \n",
819
+ "39059 3569598 Archaeoprepona licomedes None \n",
820
+ "38163 3569598 Adelpha mesentina None \n",
821
+ "\n",
822
+ "[7 rows x 25 columns]"
823
+ ]
824
+ },
825
+ "execution_count": 22,
826
+ "metadata": {},
827
+ "output_type": "execute_result"
828
+ }
829
+ ],
830
+ "source": [
831
+ "df.sample(7)"
832
+ ]
833
+ },
834
+ {
835
+ "cell_type": "markdown",
836
+ "metadata": {},
837
+ "source": [
838
+ "### Add Genus Column\n",
839
+ "\n",
840
+ "This willl allow us to easily remove all non Heliconius samples, and make some image stats easier to see."
841
+ ]
842
+ },
843
+ {
844
+ "cell_type": "code",
845
+ "execution_count": 23,
846
+ "metadata": {},
847
+ "outputs": [],
848
+ "source": [
849
+ "def get_genus(species):\n",
850
+ " if type(species) != float: #taxa name not null\n",
851
+ " return species.split(sep = \" \")[0]\n",
852
+ " return species"
853
+ ]
854
+ },
855
+ {
856
+ "cell_type": "code",
857
+ "execution_count": 24,
858
+ "metadata": {},
859
+ "outputs": [
860
+ {
861
+ "data": {
862
+ "text/plain": [
863
+ "94"
864
+ ]
865
+ },
866
+ "execution_count": 24,
867
+ "metadata": {},
868
+ "output_type": "execute_result"
869
+ }
870
+ ],
871
+ "source": [
872
+ "df[\"genus\"] = df[\"species\"].apply(get_genus)\n",
873
+ "df.genus.nunique()"
874
+ ]
875
+ },
876
+ {
877
+ "cell_type": "markdown",
878
+ "metadata": {},
879
+ "source": [
880
+ "Final stats for all data summarized here."
881
+ ]
882
+ },
883
+ {
884
+ "cell_type": "code",
885
+ "execution_count": 25,
886
+ "metadata": {},
887
+ "outputs": [
888
+ {
889
+ "data": {
890
+ "text/plain": [
891
+ "CAMID 12586\n",
892
+ "X 49359\n",
893
+ "Image_name 37821\n",
894
+ "View 7\n",
895
+ "zenodo_name 36\n",
896
+ "zenodo_link 32\n",
897
+ "Sequence 11301\n",
898
+ "Taxonomic_Name 363\n",
899
+ "Locality 645\n",
900
+ "Sample_accession 1571\n",
901
+ "Collected_by 12\n",
902
+ "Other_ID 3088\n",
903
+ "Date 810\n",
904
+ "Dataset 8\n",
905
+ "Store 142\n",
906
+ "Brood 226\n",
907
+ "Death_Date 82\n",
908
+ "Cross_Type 30\n",
909
+ "Stage 1\n",
910
+ "Sex 3\n",
911
+ "Unit_Type 6\n",
912
+ "file_type 3\n",
913
+ "record_number 32\n",
914
+ "species 246\n",
915
+ "subspecies 156\n",
916
+ "genus 94\n",
917
+ "dtype: int64"
918
+ ]
919
+ },
920
+ "execution_count": 25,
921
+ "metadata": {},
922
+ "output_type": "execute_result"
923
+ }
924
+ ],
925
+ "source": [
926
+ "df.nunique()"
927
+ ]
928
+ },
929
+ {
930
+ "cell_type": "code",
931
+ "execution_count": 26,
932
+ "metadata": {},
933
+ "outputs": [
934
+ {
935
+ "name": "stdout",
936
+ "output_type": "stream",
937
+ "text": [
938
+ "<class 'pandas.core.frame.DataFrame'>\n",
939
+ "RangeIndex: 49359 entries, 0 to 49358\n",
940
+ "Data columns (total 26 columns):\n",
941
+ " # Column Non-Null Count Dtype \n",
942
+ "--- ------ -------------- ----- \n",
943
+ " 0 CAMID 49359 non-null object\n",
944
+ " 1 X 49359 non-null int64 \n",
945
+ " 2 Image_name 49359 non-null object\n",
946
+ " 3 View 48288 non-null object\n",
947
+ " 4 zenodo_name 49359 non-null object\n",
948
+ " 5 zenodo_link 49359 non-null object\n",
949
+ " 6 Sequence 48424 non-null object\n",
950
+ " 7 Taxonomic_Name 45473 non-null object\n",
951
+ " 8 Locality 34015 non-null object\n",
952
+ " 9 Sample_accession 5884 non-null object\n",
953
+ " 10 Collected_by 5280 non-null object\n",
954
+ " 11 Other_ID 14382 non-null object\n",
955
+ " 12 Date 33718 non-null object\n",
956
+ " 13 Dataset 40405 non-null object\n",
957
+ " 14 Store 39485 non-null object\n",
958
+ " 15 Brood 14942 non-null object\n",
959
+ " 16 Death_Date 318 non-null object\n",
960
+ " 17 Cross_Type 5133 non-null object\n",
961
+ " 18 Stage 15 non-null object\n",
962
+ " 19 Sex 36243 non-null object\n",
963
+ " 20 Unit_Type 33890 non-null object\n",
964
+ " 21 file_type 49359 non-null object\n",
965
+ " 22 record_number 49359 non-null object\n",
966
+ " 23 species 45473 non-null object\n",
967
+ " 24 subspecies 25715 non-null object\n",
968
+ " 25 genus 45473 non-null object\n",
969
+ "dtypes: int64(1), object(25)\n",
970
+ "memory usage: 9.8+ MB\n"
971
+ ]
972
+ }
973
+ ],
974
+ "source": [
975
+ "df.info()"
976
+ ]
977
+ },
978
+ {
979
+ "cell_type": "markdown",
980
+ "metadata": {},
981
+ "source": [
982
+ "Observe that not all images have a species label."
983
+ ]
984
+ },
985
+ {
986
+ "cell_type": "code",
987
+ "execution_count": 27,
988
+ "metadata": {},
989
+ "outputs": [
990
+ {
991
+ "data": {
992
+ "text/html": [
993
+ "<div>\n",
994
+ "<style scoped>\n",
995
+ " .dataframe tbody tr th:only-of-type {\n",
996
+ " vertical-align: middle;\n",
997
+ " }\n",
998
+ "\n",
999
+ " .dataframe tbody tr th {\n",
1000
+ " vertical-align: top;\n",
1001
+ " }\n",
1002
+ "\n",
1003
+ " .dataframe thead th {\n",
1004
+ " text-align: right;\n",
1005
+ " }\n",
1006
+ "</style>\n",
1007
+ "<table border=\"1\" class=\"dataframe\">\n",
1008
+ " <thead>\n",
1009
+ " <tr style=\"text-align: right;\">\n",
1010
+ " <th></th>\n",
1011
+ " <th>CAMID</th>\n",
1012
+ " <th>X</th>\n",
1013
+ " <th>Image_name</th>\n",
1014
+ " <th>View</th>\n",
1015
+ " <th>zenodo_name</th>\n",
1016
+ " <th>zenodo_link</th>\n",
1017
+ " <th>Sequence</th>\n",
1018
+ " <th>Taxonomic_Name</th>\n",
1019
+ " <th>Locality</th>\n",
1020
+ " <th>Sample_accession</th>\n",
1021
+ " <th>...</th>\n",
1022
+ " <th>Death_Date</th>\n",
1023
+ " <th>Cross_Type</th>\n",
1024
+ " <th>Stage</th>\n",
1025
+ " <th>Sex</th>\n",
1026
+ " <th>Unit_Type</th>\n",
1027
+ " <th>file_type</th>\n",
1028
+ " <th>record_number</th>\n",
1029
+ " <th>species</th>\n",
1030
+ " <th>subspecies</th>\n",
1031
+ " <th>genus</th>\n",
1032
+ " </tr>\n",
1033
+ " </thead>\n",
1034
+ " <tbody>\n",
1035
+ " <tr>\n",
1036
+ " <th>48538</th>\n",
1037
+ " <td>E24</td>\n",
1038
+ " <td>37559</td>\n",
1039
+ " <td>E24_d.CR2</td>\n",
1040
+ " <td>dorsal</td>\n",
1041
+ " <td>Anniina.Matilla.Field.Caught.E.csv</td>\n",
1042
+ " <td>https://zenodo.org/record/2554218</td>\n",
1043
+ " <td>NaN</td>\n",
1044
+ " <td>NaN</td>\n",
1045
+ " <td>NaN</td>\n",
1046
+ " <td>NaN</td>\n",
1047
+ " <td>...</td>\n",
1048
+ " <td>NaN</td>\n",
1049
+ " <td>NaN</td>\n",
1050
+ " <td>NaN</td>\n",
1051
+ " <td>NaN</td>\n",
1052
+ " <td>NaN</td>\n",
1053
+ " <td>raw</td>\n",
1054
+ " <td>2554218</td>\n",
1055
+ " <td>NaN</td>\n",
1056
+ " <td>None</td>\n",
1057
+ " <td>NaN</td>\n",
1058
+ " </tr>\n",
1059
+ " <tr>\n",
1060
+ " <th>37246</th>\n",
1061
+ " <td>CAM042045</td>\n",
1062
+ " <td>43973</td>\n",
1063
+ " <td>CAM042045_v.JPG</td>\n",
1064
+ " <td>ventral</td>\n",
1065
+ " <td>Collection_August2019.csv</td>\n",
1066
+ " <td>https://zenodo.org/record/5731587</td>\n",
1067
+ " <td>42,045</td>\n",
1068
+ " <td>NaN</td>\n",
1069
+ " <td>NaN</td>\n",
1070
+ " <td>NaN</td>\n",
1071
+ " <td>...</td>\n",
1072
+ " <td>NaN</td>\n",
1073
+ " <td>NaN</td>\n",
1074
+ " <td>NaN</td>\n",
1075
+ " <td>NaN</td>\n",
1076
+ " <td>NaN</td>\n",
1077
+ " <td>jpg</td>\n",
1078
+ " <td>5731587</td>\n",
1079
+ " <td>NaN</td>\n",
1080
+ " <td>None</td>\n",
1081
+ " <td>NaN</td>\n",
1082
+ " </tr>\n",
1083
+ " <tr>\n",
1084
+ " <th>37484</th>\n",
1085
+ " <td>CAM042166</td>\n",
1086
+ " <td>44211</td>\n",
1087
+ " <td>CAM042166_v.JPG</td>\n",
1088
+ " <td>ventral</td>\n",
1089
+ " <td>Collection_August2019.csv</td>\n",
1090
+ " <td>https://zenodo.org/record/5731587</td>\n",
1091
+ " <td>42,166</td>\n",
1092
+ " <td>NaN</td>\n",
1093
+ " <td>NaN</td>\n",
1094
+ " <td>NaN</td>\n",
1095
+ " <td>...</td>\n",
1096
+ " <td>NaN</td>\n",
1097
+ " <td>NaN</td>\n",
1098
+ " <td>NaN</td>\n",
1099
+ " <td>NaN</td>\n",
1100
+ " <td>NaN</td>\n",
1101
+ " <td>jpg</td>\n",
1102
+ " <td>5731587</td>\n",
1103
+ " <td>NaN</td>\n",
1104
+ " <td>None</td>\n",
1105
+ " <td>NaN</td>\n",
1106
+ " </tr>\n",
1107
+ " <tr>\n",
1108
+ " <th>48780</th>\n",
1109
+ " <td>E83</td>\n",
1110
+ " <td>37777</td>\n",
1111
+ " <td>E83_v.CR2</td>\n",
1112
+ " <td>ventral</td>\n",
1113
+ " <td>Anniina.Matilla.Field.Caught.E.csv</td>\n",
1114
+ " <td>https://zenodo.org/record/2554218</td>\n",
1115
+ " <td>NaN</td>\n",
1116
+ " <td>NaN</td>\n",
1117
+ " <td>NaN</td>\n",
1118
+ " <td>NaN</td>\n",
1119
+ " <td>...</td>\n",
1120
+ " <td>NaN</td>\n",
1121
+ " <td>NaN</td>\n",
1122
+ " <td>NaN</td>\n",
1123
+ " <td>NaN</td>\n",
1124
+ " <td>NaN</td>\n",
1125
+ " <td>raw</td>\n",
1126
+ " <td>2554218</td>\n",
1127
+ " <td>NaN</td>\n",
1128
+ " <td>None</td>\n",
1129
+ " <td>NaN</td>\n",
1130
+ " </tr>\n",
1131
+ " <tr>\n",
1132
+ " <th>3118</th>\n",
1133
+ " <td>19N2627</td>\n",
1134
+ " <td>22498</td>\n",
1135
+ " <td>19N2627_v.CR2</td>\n",
1136
+ " <td>NaN</td>\n",
1137
+ " <td>0.sheffield.ps.nn.ikiam.batch2.csv</td>\n",
1138
+ " <td>https://zenodo.org/record/4288311</td>\n",
1139
+ " <td>0</td>\n",
1140
+ " <td>NaN</td>\n",
1141
+ " <td>NaN</td>\n",
1142
+ " <td>NaN</td>\n",
1143
+ " <td>...</td>\n",
1144
+ " <td>NaN</td>\n",
1145
+ " <td>NaN</td>\n",
1146
+ " <td>NaN</td>\n",
1147
+ " <td>NaN</td>\n",
1148
+ " <td>NaN</td>\n",
1149
+ " <td>raw</td>\n",
1150
+ " <td>4288311</td>\n",
1151
+ " <td>NaN</td>\n",
1152
+ " <td>None</td>\n",
1153
+ " <td>NaN</td>\n",
1154
+ " </tr>\n",
1155
+ " <tr>\n",
1156
+ " <th>46111</th>\n",
1157
+ " <td>CAM045060</td>\n",
1158
+ " <td>42806</td>\n",
1159
+ " <td>CAM045060_v.CR2</td>\n",
1160
+ " <td>ventral</td>\n",
1161
+ " <td>image.names.cook.island.erato.csv</td>\n",
1162
+ " <td>https://zenodo.org/record/5526257</td>\n",
1163
+ " <td>45,060</td>\n",
1164
+ " <td>NaN</td>\n",
1165
+ " <td>NaN</td>\n",
1166
+ " <td>NaN</td>\n",
1167
+ " <td>...</td>\n",
1168
+ " <td>NaN</td>\n",
1169
+ " <td>NaN</td>\n",
1170
+ " <td>NaN</td>\n",
1171
+ " <td>NaN</td>\n",
1172
+ " <td>NaN</td>\n",
1173
+ " <td>raw</td>\n",
1174
+ " <td>5526257</td>\n",
1175
+ " <td>NaN</td>\n",
1176
+ " <td>None</td>\n",
1177
+ " <td>NaN</td>\n",
1178
+ " </tr>\n",
1179
+ " <tr>\n",
1180
+ " <th>39502</th>\n",
1181
+ " <td>CAM043576</td>\n",
1182
+ " <td>31097</td>\n",
1183
+ " <td>CAM043576_v.CR2</td>\n",
1184
+ " <td>ventral</td>\n",
1185
+ " <td>batch2.Peru.image.names.Zenodo.csv</td>\n",
1186
+ " <td>https://zenodo.org/record/4287444</td>\n",
1187
+ " <td>43,576</td>\n",
1188
+ " <td>NaN</td>\n",
1189
+ " <td>NaN</td>\n",
1190
+ " <td>NaN</td>\n",
1191
+ " <td>...</td>\n",
1192
+ " <td>NaN</td>\n",
1193
+ " <td>NaN</td>\n",
1194
+ " <td>NaN</td>\n",
1195
+ " <td>NaN</td>\n",
1196
+ " <td>NaN</td>\n",
1197
+ " <td>raw</td>\n",
1198
+ " <td>4287444</td>\n",
1199
+ " <td>NaN</td>\n",
1200
+ " <td>None</td>\n",
1201
+ " <td>NaN</td>\n",
1202
+ " </tr>\n",
1203
+ " </tbody>\n",
1204
+ "</table>\n",
1205
+ "<p>7 rows × 26 columns</p>\n",
1206
+ "</div>"
1207
+ ],
1208
+ "text/plain": [
1209
+ " CAMID X Image_name View \\\n",
1210
+ "48538 E24 37559 E24_d.CR2 dorsal \n",
1211
+ "37246 CAM042045 43973 CAM042045_v.JPG ventral \n",
1212
+ "37484 CAM042166 44211 CAM042166_v.JPG ventral \n",
1213
+ "48780 E83 37777 E83_v.CR2 ventral \n",
1214
+ "3118 19N2627 22498 19N2627_v.CR2 NaN \n",
1215
+ "46111 CAM045060 42806 CAM045060_v.CR2 ventral \n",
1216
+ "39502 CAM043576 31097 CAM043576_v.CR2 ventral \n",
1217
+ "\n",
1218
+ " zenodo_name zenodo_link \\\n",
1219
+ "48538 Anniina.Matilla.Field.Caught.E.csv https://zenodo.org/record/2554218 \n",
1220
+ "37246 Collection_August2019.csv https://zenodo.org/record/5731587 \n",
1221
+ "37484 Collection_August2019.csv https://zenodo.org/record/5731587 \n",
1222
+ "48780 Anniina.Matilla.Field.Caught.E.csv https://zenodo.org/record/2554218 \n",
1223
+ "3118 0.sheffield.ps.nn.ikiam.batch2.csv https://zenodo.org/record/4288311 \n",
1224
+ "46111 image.names.cook.island.erato.csv https://zenodo.org/record/5526257 \n",
1225
+ "39502 batch2.Peru.image.names.Zenodo.csv https://zenodo.org/record/4287444 \n",
1226
+ "\n",
1227
+ " Sequence Taxonomic_Name Locality Sample_accession ... Death_Date \\\n",
1228
+ "48538 NaN NaN NaN NaN ... NaN \n",
1229
+ "37246 42,045 NaN NaN NaN ... NaN \n",
1230
+ "37484 42,166 NaN NaN NaN ... NaN \n",
1231
+ "48780 NaN NaN NaN NaN ... NaN \n",
1232
+ "3118 0 NaN NaN NaN ... NaN \n",
1233
+ "46111 45,060 NaN NaN NaN ... NaN \n",
1234
+ "39502 43,576 NaN NaN NaN ... NaN \n",
1235
+ "\n",
1236
+ " Cross_Type Stage Sex Unit_Type file_type record_number species \\\n",
1237
+ "48538 NaN NaN NaN NaN raw 2554218 NaN \n",
1238
+ "37246 NaN NaN NaN NaN jpg 5731587 NaN \n",
1239
+ "37484 NaN NaN NaN NaN jpg 5731587 NaN \n",
1240
+ "48780 NaN NaN NaN NaN raw 2554218 NaN \n",
1241
+ "3118 NaN NaN NaN NaN raw 4288311 NaN \n",
1242
+ "46111 NaN NaN NaN NaN raw 5526257 NaN \n",
1243
+ "39502 NaN NaN NaN NaN raw 4287444 NaN \n",
1244
+ "\n",
1245
+ " subspecies genus \n",
1246
+ "48538 None NaN \n",
1247
+ "37246 None NaN \n",
1248
+ "37484 None NaN \n",
1249
+ "48780 None NaN \n",
1250
+ "3118 None NaN \n",
1251
+ "46111 None NaN \n",
1252
+ "39502 None NaN \n",
1253
+ "\n",
1254
+ "[7 rows x 26 columns]"
1255
+ ]
1256
+ },
1257
+ "execution_count": 27,
1258
+ "metadata": {},
1259
+ "output_type": "execute_result"
1260
+ }
1261
+ ],
1262
+ "source": [
1263
+ "df.loc[df.species.isna()].sample(7)"
1264
+ ]
1265
+ },
1266
+ {
1267
+ "cell_type": "markdown",
1268
+ "metadata": {},
1269
+ "source": [
1270
+ "### Update Master File with Genus through Subspecies Columns"
1271
+ ]
1272
+ },
1273
+ {
1274
+ "cell_type": "code",
1275
+ "execution_count": 28,
1276
+ "metadata": {},
1277
+ "outputs": [],
1278
+ "source": [
1279
+ "df.to_csv(\"../Jiggins_Zenodo_Img_Master.csv\", index = False)"
1280
+ ]
1281
+ },
1282
+ {
1283
+ "cell_type": "markdown",
1284
+ "metadata": {},
1285
+ "source": [
1286
+ "### Make Heliconius Subset"
1287
+ ]
1288
+ },
1289
+ {
1290
+ "cell_type": "code",
1291
+ "execution_count": 29,
1292
+ "metadata": {},
1293
+ "outputs": [
1294
+ {
1295
+ "name": "stdout",
1296
+ "output_type": "stream",
1297
+ "text": [
1298
+ "<class 'pandas.core.frame.DataFrame'>\n",
1299
+ "Index: 34929 entries, 6 to 49358\n",
1300
+ "Data columns (total 26 columns):\n",
1301
+ " # Column Non-Null Count Dtype \n",
1302
+ "--- ------ -------------- ----- \n",
1303
+ " 0 CAMID 34929 non-null object\n",
1304
+ " 1 X 34929 non-null int64 \n",
1305
+ " 2 Image_name 34929 non-null object\n",
1306
+ " 3 View 34150 non-null object\n",
1307
+ " 4 zenodo_name 34929 non-null object\n",
1308
+ " 5 zenodo_link 34929 non-null object\n",
1309
+ " 6 Sequence 34929 non-null object\n",
1310
+ " 7 Taxonomic_Name 34929 non-null object\n",
1311
+ " 8 Locality 23417 non-null object\n",
1312
+ " 9 Sample_accession 5860 non-null object\n",
1313
+ " 10 Collected_by 5280 non-null object\n",
1314
+ " 11 Other_ID 6404 non-null object\n",
1315
+ " 12 Date 23162 non-null object\n",
1316
+ " 13 Dataset 32846 non-null object\n",
1317
+ " 14 Store 29446 non-null object\n",
1318
+ " 15 Brood 14921 non-null object\n",
1319
+ " 16 Death_Date 316 non-null object\n",
1320
+ " 17 Cross_Type 5133 non-null object\n",
1321
+ " 18 Stage 6 non-null object\n",
1322
+ " 19 Sex 33880 non-null object\n",
1323
+ " 20 Unit_Type 31975 non-null object\n",
1324
+ " 21 file_type 34929 non-null object\n",
1325
+ " 22 record_number 34929 non-null object\n",
1326
+ " 23 species 34929 non-null object\n",
1327
+ " 24 subspecies 24953 non-null object\n",
1328
+ " 25 genus 34929 non-null object\n",
1329
+ "dtypes: int64(1), object(25)\n",
1330
+ "memory usage: 7.2+ MB\n"
1331
+ ]
1332
+ }
1333
+ ],
1334
+ "source": [
1335
+ "heliconius_subset = df.loc[df.genus.str.lower() == \"heliconius\"]\n",
1336
+ "\n",
1337
+ "heliconius_subset.info()"
1338
+ ]
1339
+ },
1340
+ {
1341
+ "cell_type": "code",
1342
+ "execution_count": 30,
1343
+ "metadata": {},
1344
+ "outputs": [
1345
+ {
1346
+ "data": {
1347
+ "text/plain": [
1348
+ "CAMID 9546\n",
1349
+ "X 34929\n",
1350
+ "Image_name 26946\n",
1351
+ "View 3\n",
1352
+ "zenodo_name 31\n",
1353
+ "zenodo_link 28\n",
1354
+ "Sequence 8701\n",
1355
+ "Taxonomic_Name 129\n",
1356
+ "Locality 472\n",
1357
+ "Sample_accession 1559\n",
1358
+ "Collected_by 12\n",
1359
+ "Other_ID 1865\n",
1360
+ "Date 776\n",
1361
+ "Dataset 8\n",
1362
+ "Store 121\n",
1363
+ "Brood 224\n",
1364
+ "Death_Date 81\n",
1365
+ "Cross_Type 30\n",
1366
+ "Stage 1\n",
1367
+ "Sex 3\n",
1368
+ "Unit_Type 4\n",
1369
+ "file_type 3\n",
1370
+ "record_number 28\n",
1371
+ "species 37\n",
1372
+ "subspecies 110\n",
1373
+ "genus 1\n",
1374
+ "dtype: int64"
1375
+ ]
1376
+ },
1377
+ "execution_count": 30,
1378
+ "metadata": {},
1379
+ "output_type": "execute_result"
1380
+ }
1381
+ ],
1382
+ "source": [
1383
+ "heliconius_subset.nunique()"
1384
+ ]
1385
+ },
1386
+ {
1387
+ "cell_type": "code",
1388
+ "execution_count": 31,
1389
+ "metadata": {},
1390
+ "outputs": [
1391
+ {
1392
+ "data": {
1393
+ "text/plain": [
1394
+ "View\n",
1395
+ "dorsal 17218\n",
1396
+ "ventral 16914\n",
1397
+ "dorsal and ventral 18\n",
1398
+ "Name: count, dtype: int64"
1399
+ ]
1400
+ },
1401
+ "execution_count": 31,
1402
+ "metadata": {},
1403
+ "output_type": "execute_result"
1404
+ }
1405
+ ],
1406
+ "source": [
1407
+ "heliconius_subset.View.value_counts()"
1408
+ ]
1409
+ },
1410
+ {
1411
+ "cell_type": "markdown",
1412
+ "metadata": {},
1413
+ "source": [
1414
+ "Note that this subset is distributed across 28 Zenodo records from the [Butterfly Genetics Group](https://zenodo.org/communities/butterfly?q=&l=list&p=1&s=10&sort=newest)."
1415
+ ]
1416
+ },
1417
+ {
1418
+ "cell_type": "markdown",
1419
+ "metadata": {},
1420
+ "source": [
1421
+ "### Save the Heliconius Subset to CSV\n",
1422
+ "We'll drop the `genus` column, since they're all `Heliconius`."
1423
+ ]
1424
+ },
1425
+ {
1426
+ "cell_type": "code",
1427
+ "execution_count": 32,
1428
+ "metadata": {},
1429
+ "outputs": [],
1430
+ "source": [
1431
+ "heliconius_subset[list(heliconius_subset.columns)[:-1]].to_csv(\"../Jiggins_Heliconius_Master.csv\", index = False)"
1432
+ ]
1433
+ },
1434
+ {
1435
+ "cell_type": "code",
1436
+ "execution_count": null,
1437
+ "metadata": {},
1438
+ "outputs": [],
1439
+ "source": []
1440
+ }
1441
+ ],
1442
+ "metadata": {
1443
+ "kernelspec": {
1444
+ "display_name": "std",
1445
+ "language": "python",
1446
+ "name": "python3"
1447
+ },
1448
+ "language_info": {
1449
+ "codemirror_mode": {
1450
+ "name": "ipython",
1451
+ "version": 3
1452
+ },
1453
+ "file_extension": ".py",
1454
+ "mimetype": "text/x-python",
1455
+ "name": "python",
1456
+ "nbconvert_exporter": "python",
1457
+ "pygments_lexer": "ipython3",
1458
+ "version": "3.11.3"
1459
+ },
1460
+ "orig_nbformat": 4
1461
+ },
1462
+ "nbformat": 4,
1463
+ "nbformat_minor": 2
1464
+ }