forked from davekk/Scripts
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
186 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
|
||
|
||
|
||
|
||
|
||
conda create -y --quiet --use-local --override-channels --channel iuc --channel bioconda --channel conda-forge --channel defaults --name __fleeqtk@1.3 fleeqtk=1.3 | ||
# or | ||
conda create --use-local --name __fleeqtk@1.3 fleeqtk=1.3 | ||
|
||
# check if env is created | ||
ls ~/miniconda3/envs/ | ||
|
||
planemo test --conda_use_local fleeqtk_seq.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
wget -qO - https://packages.irods.org/irods-signing-key.asc | sudo apt-key add - | ||
echo "deb [arch=amd64] https://packages.irods.org/apt/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/renci-irods.list | ||
sudo apt-get update # this primes the system for installation | ||
|
||
sudo apt-get install irods-icommands # installs | ||
|
||
iinit # initialise for log in details | ||
ils # iplant version of ls | ||
|
||
iput -rPT Documents/hello_world/test-data /iplant/home/dave_k/ # upload directory (bulk upload) directly to home directory in cyverse | ||
|
||
icp /iplant/home/mukani/analyses/tutorial_data.csv /iplant/home/dave_k/ # iplant version of coy from one folder to another in cyverse | ||
|
||
iget -Pf /iplant/home/dave_k/Ordered_snp_allele.csv # download file from path in cyverse to path in curent shell | ||
|
||
ils -l | awk '{ print $7 " " $4 }' # print the name nd size of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
|
||
for ((i=1;i<=100;i++));do echo foo$i; sleep 1;done | ||
for ((i=1;i<100;i++)); do echo foo$i; sleep 1; done | ||
|
||
sudo adduser --home /home/<username> <username> # create use | ||
|
||
sudo chown -R beca-09:beca-09 .ssh/ # change permissions to vm | ||
|
||
ssh-keygen -t rsa # generate key for successful login | ||
|
||
# copy the .pub key from the patner into the last entry in authorised-key file. | ||
|
||
ssh <username>@<ip_address> # way to ssh to user | ||
ssh -i .ssh/authorized_keys beca-11@10.0.72.60 | ||
|
||
## | ||
sudo mkdir /home/<newuser>/<.ssh> # create a new file in users directory | ||
sudo vi /home/<newuser>/<.ssh>/<authorized_keys> # create key file for user to successfully login | ||
|
||
sudo usermod -aG sudo <newuser> # allow newuser to be su | ||
|
||
# now to docker | ||
sudo apt-get update # Update the apt package index: | ||
|
||
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common # Install packages to allow apt to use a repository over HTTPS: | ||
|
||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - # Add Docker’s official GPG key | ||
|
||
sudo apt-key fingerprint 0EBFCD88 # Verify that you now have the key with the fingerprint last 8 digits | ||
|
||
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" # set up the stable repository | ||
|
||
sudo apt-get update # Update the apt package index. | ||
|
||
sudo apt-get install docker-ce # Install the latest version of Docker CE | ||
|
||
sudo docker run hello-world # Verify that Docker CE is installed correctly by running the hello-world image. | ||
|
||
sudo docker run docker/whalesay cowsay "$(fortune)" # second test | ||
|
||
sudo usermod -aG docker beca-09 # add docker to su group | ||
|
||
docker run -ti centos # run latest centos image | ||
|
||
docker run -ti centos:7 # run centos 7 image | ||
|
||
docker start <container_id> # start the container saved | ||
|
||
docker attach <container_id> # load the started container | ||
|
||
docker commit mysoft1 centoswith # save the container as image with files and changes | ||
|
||
docker run --volume myfirstvol:/root/newfolder -ti centos:7 # create a volume using centos | ||
# touch /root/newfolder/docvol.txt | ||
|
||
sudo su - # turn to root user | ||
|
||
cat /var/lib/docker/volumes/myfirstvol/_data/docvol.txt # view the file created in volume cmd above | ||
|
||
docker run --volume myfirstvol:/root/newfolder2:ro -ti centos # load a read only folder/file | ||
|
||
# a docker file needs to be named .docker | ||
# the centos base image | ||
FROM centos:7 | ||
|
||
# labels | ||
LABEL centos.version="7" | ||
|
||
# apps to install | ||
|
||
RUN yum -y update && yum -yy install vim | ||
RUN useradd beca-09 | ||
ADD <url_of_file_to_be_used> <location/where/to/be/downloaded> # will be created if non-existent | ||
|
||
USER beca-09 | ||
# the working directory | ||
WORKDIR /home/ | ||
|
||
docker build -t vimimage . | ||
|
||
#entry point addition to the docker file | ||
|
||
ENTRYPOINT ["/bin/echo", "hello world!"] | ||
|
||
|
||
docker build -t vimimagecho . # build new image | ||
|
||
docker run vimimagecho # run new image | ||
|
||
docker run --entrypoint "/bin/which" entrypoint ls # to modify the entrypoint executable | ||
|
||
docker run -ti --entrypoint "/bin/bash" vimimagecho # to run the image interactively | ||
|
||
echo $null >Dockerfile # empty the file | ||
|
||
docker ps -aq -f status=exited # list all exited containers | ||
|
||
docker ps -aq --no-trunc -f status=exited | xargs docker rm # Remove stopped containers | ||
|
||
docker ps --since 6bb20a720eb4 -q | xargs docker rm #Remove containers created after a specific container | ||
|
||
Rscript 100_tree.R # in the container | ||
|
||
docker rmi --force <IMAGEID> # to forcefully remove an image as well as the attached containers |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
samtools tview SRR3134441_tr.bam ../Map/Zea_mays.AGPv4.dna.toplevel.fa | ||
for f in *; do echo "Processing ${f}"; module load samtools; samtools index ${f};done | ||
#### vim script for creating a soap index | ||
#!/bin/bash | ||
#SBATCH -J soap_indexing | ||
#SBATCH -p batch | ||
#SBATCH -n 4 | ||
#SBATCH --mail-user=DKaimenyi@cgiar.org | ||
#SBATCH -o ./soap_index.%N.%j.out | ||
#SBATCH -e ./soap_index.%N.%j.err | ||
#SBATCH --mail-type=END,FAIL | ||
|
||
cd /home/dkiambi/reads/new_map | ||
|
||
module load SOAPaligner/2.21 | ||
|
||
2bwt-builder ./Zea_mays.AGPv4.dna.toplevel.fa -p 10 | ||
|
||
###multiple jobs | ||
#!/bin/bash | ||
#SBATCH -J soap_map_41_un_dave | ||
#SBATCH -p batch | ||
#SBATCH -n 4 | ||
#SBATCH --mail-user=D.Kaimenyi@cgiar.org | ||
#SBATCH -o ./soap_map_utr_41.%N.%j.out | ||
#SBATCH -e ./soap_map_untr_41.%N.%j.err | ||
#SBATCH --mail-type=END,FAIL | ||
|
||
cd /home/dkiambi/reads | ||
|
||
module purge | ||
|
||
module load SOAPaligner/2.21 | ||
|
||
soap -D ./new_map/Zea_mays.AGPv4.dna.toplevel.fa.index -a ./reads/SRR3134441/SRR3134441_1.fastq.gz -b ./reads/SRR3134441/SRR3134441_2.fastq.gz -o ./SRR3134441_unt_soap.txt -2 ./SRR3134441_unt_soap_unpaired.txt -M 4 -p 10 | ||
|
||
for f in *.sh; do echo "submitting ${f}"; sbatch ${f};done | ||
|
||
# viewing allingment | ||
cd /var/scratch/Dave/Exercise/reads/ | ||
module load tablet | ||
tablet | ||
## blast workthrough | ||
module load blast | ||
makeblastdb -in Exercise/reads/Map/Zea_mays.AGPv4.dna.toplevel.fa -dbtype nucl | ||
blastn -query GW2_rice.fa -db Exercise/reads/Map/Zea_mays.AGPv4.dna.toplevel.fa -out maize_blast.txt -evalue 0.00001 -outfmt 7 | ||
|
||
blastx -query GW2_rice.fa -db nr -out gw2_blastx.txt -num_threads 10 -max_target_seqs 20 -best_hit_score_edge 0.25 | ||
|
||
## Generating fasta statistics for downloaded genomes | ||
for f in ./*; do echo "processing ${f}"; module load seqkit/0.7.2; seqkit stats ${f}; done | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.