Comments (3)
Instead of using the associative array in bash 4 in for
loop, we can use a simpler array like this:
list=(
9606 "Homo sapiens" "Human"
4932 "Saccharomyces cerevisiae" "S. cerevisiae"
10090 "Mus musculus" "Mouse",
10116 "Rattus norvegicus" "Rat",
6239 "Caenorhabditis elegans" "C. elegans"
3702 "Arabidopsis thaliana" "Arabidopsis"
7227 "Drosophila melanogaster" "Fruit fly"
7955 "Danio rerio" "Zebrafish"
208964 "Pseudomonas aeruginosa" "Pseudomonas aeruginosa"
)
count=0
while [ "x${list[count]}" != "x" ]; do
id=${list[count]}
sci_name=${list[count + 1]}
common_name=${list[count + 2]}
python manage.py organisms_create_or_update --taxonomy_id=$id \
--scientific_name="$sci_name" --common_name="$common_name"
count=$(( $count + 3 ))
done
This is an example to replace lines 9-26 of tribe/load_organisms_and_genes_to_db.sh
. (May not be the best solution, but it is something worth trying.)
from tribe.
Yes, for lines 67-178, you will have to include other fields in the array too. For lines 28-62, the array will include both the name and url.
It also depends on whether you may need to add more python manage xxx
commands or not. The more you need to add in, the larger benefit a for
loop will give you.
from tribe.
@dongbohu - Thanks, I agree. Probably the list will need to include the location of the data files for each organism and the systematic_col number if we want to replace lines 67-178. In terms of lines 28-62, it looks like declaring the array and running the loop might be more trouble than it's worth.
from tribe.
Related Issues (20)
- Tweaks for interface deployment needed HOT 2
- Link to a specific version of a Tribe geneset via UI HOT 1
- Dockerize Backend Services
- Some packages need to be updated HOT 3
- Replace Bower with npm or other tools HOT 2
- Front end building warnings HOT 1
- Deprecated front end pkg: "grunt-ngmin" and "grunt-recess" HOT 4
- interface/README.md should be updated HOT 1
- Settings not friendly HOT 1
- Replace Codeship with CircleCI or Travis? HOT 1
- Django Upgrade (1.8 to 1.11) HOT 11
- Py2 -> Py3
- Elasticsearch 5.X: "snowball" analyzer deprecated? HOT 1
- Frontend: Google Analytics shows previous page's title HOT 1
- Trivial: `/favicon.ico` needed
- "BaseCommand.option_list" is deprecated HOT 1
- Use Postgres built-in search functionalities instead of Elasticsearch?
- Confirmation Emails of signup and password reset: content should be customized HOT 2
- Generalized database schema HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tribe.