#change to the etc/profile.d directory #have to use "//" before "etc"; first "/" moves up to the "/root" directory #second slash moves down to the "etc" directory cd //etc/profile.d #write BLAST program directory to new scipt file !echo '#!/bin/bash' > myenvvars.sh #check permissions of directory ls -ld !ls -ld Don't have permissions, so have to use "sudo" to do this, which I can't do in IPython because it doens't allow password entry. Be right back; going to Terminal to do this. Ran this command in Terminal: samb@Mephisto://etc/profile.d$ sudo chmod -R 775 /etc/profile.d #check directory permissions now !ls -ld #let's try making and writing to the script file again !echo '#!/bin/bash' > myenvvars.sh After Googling, changed permissions back to 755 using: samb@Mephisto://etc/profile.d$ sudo chmod -R 755 /etc/profile.d !ls -ld Created file called "myenvvars.sh" using: samb@Mephisto://etc/profile.d$ sudo touch myenvvars.sh !ls Couldn't figure out how to write to the file using Terminal; permission denied on all my various attempts. Tried each of these: sudo cat '#!/bin/bash' > myenvvars.sh sudo echo '#!/bin/bash' > myenvvars.sh sudo '#!/bin/bash' > myenvvars.sh Got this output from all of them: bash: myenvvars.sh: Permission denied So, I resorted to using the program gedit: sudo gedit myenvvars.sh This opens the gedit visual text editor. Added these three lines to make the script file: !#/bin/bash export PATH=$PATH:/media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/bin: export BLASTDB=/media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/dbs Probably have to restart the Terminal or even the computer to have these changes be implemented. Try just restarting Terminal first. #see if BLAST is listed in PATH !echo $PATH Not listed. Will restart computer. BRB... #see if BLAST is listed in PATH after computer restart !echo $PATH Cool! Restarting worked! Let's just do a quick BLAST check. !blastn -h !blastn --help !blastn -help #let's check permissions of the BLAST folder ls -ld /media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/bin !ls -ld /media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+/bin Well, this is discouraging. Tried running blast in just the Terminal. Typing "blastn" simply printed out the PATH to the blast folder. At the end of that output there was a colon; removed that colon from myenvvars.sh file using gedit. Restarting computer. #check the PATH again !echo $PATH #try blast again !blastn -help Well, I think this is an issue of trying to use the Windows partition (which is the larger of the two partitions; thus why I want to have blast and its databases stored there). Guess I'll have to move blast to the Linux partition. #moving (mv) blast folder to Linux partition, using the verbose (-v) argument mv -v /media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+ /home/samb #forgot the stupid "!" needed in IPython !mv -v /media/B0FE4B1FFE4ADD6A/BioinformaticsTools/ncbi-blast-2.2.29+ /home/samb/BioinformaticsTools Whoops! I HAD moved the blast folder to the "/home/samb" directory, but should've moved it to the BioinformaticsTools folder, but forgot. Then, I edited the above line and that's why the error message is spit out. Manually moved the blast folder from "/home/samb" to "/home/samb/BioinformaticsTools"Change the PATH in the myenvvars.sh file using gedit. Need to restart computer for changes to take effect. #check new PATH !echo $PATH Looks good. Let's see if we can get a quick BLAST command to run. !blastn -h Well, this blows. Going to just try reinstalling BLAST, but in this directory. Maybe problem is that you can't just move the BLAST directory? #testing "fresh" install of BLAST package on Linux partition !blastn -h Yes! FINALLY! It works. Looks like BLAST package needs to be installed in the desired directory for it to function properly; can't simply move files to a new location after an initial install. Now, let's try an actual BLAST to see if the database directory works, too. !blastn -task blastn -query /home/samb/BioinformaticsTools/ncbi-blast-2.2.29+/queries/AllAbDenovo7118contigs.fa -db RickettsiaGBnt20140228 -outfmt 6 -max_target_seqs 1 -num_threads 16 -out /home/samb/BioinformaticsTools/ncbi-blast-2.2.29+/outputs/test.txt #hadn't restarted the computer since I changed the "myenvvars.sh" file to reflect update db location #let's try again !blastn -task blastn -query /home/samb/BioinformaticsTools/ncbi-blast-2.2.29+/queries/AllAbDenovo7118contigs.fa -db RickettsiaGBnt20140228 -outfmt 6 -max_target_seqs 1 -num_threads 16 -out /home/samb/BioinformaticsTools/ncbi-blast-2.2.29+/outputs/test.txt Wait, I didn't read the error message correctly. It's searching in the IPython Notebook directory? That's weird. Time for more troubleshooting. OK, I think I fixed it. It turns out that the "myenvvars.sh" file was lacking the "export" command for the BLASTDB variable/location. Will restart computer and try again. #Another try with the "myenvvars.sh" file fixed !blastn -task blastn -query /home/samb/BioinformaticsTools/ncbi-blast-2.2.29+/queries/AllAbDenovo7118contigs.fa -db RickettsiaGBnt20140228 -outfmt 6 -max_target_seqs 1 -num_threads 16 -out /home/samb/BioinformaticsTools/ncbi-blast-2.2.29+/outputs/test.txt Sweet! That worked; we're all set! Now, want to try using the "time" command with this, just for fun. The "time" command should tell me how long it takes for a task to run. !time blastn -task blastn -query /home/samb/BioinformaticsTools/ncbi-blast-2.2.29+/queries/AllAbDenovo7118contigs.fa -db RickettsiaGBnt20140228 -outfmt 6 -max_target_seqs 1 -num_threads 16 -out /home/samb/BioinformaticsTools/ncbi-blast-2.2.29+/outputs/test.txt