SRAtoolkit not working without using home directory - ncbi

I am working with NCBI's SRAtoolkit 2.11.0 mac64. I just successfully configured the toolkit using vdb-config -i but I am unable to access any commands if I am not working in the bins file, using ./ before every command. This of course overrides my pre-established filepath to dump the sequence reads and instead deposits them into the bin file.
How can I use SRAtoolkit without using ./ constantly?
Thank you

In case someone is having the same issue, here was my solution. I used bioinfokit (pip install bioinfokit). My commands in order:
export PATH=$PATH:/filepath/sratoolkit.2.11.0-mac64/bin
source nucelotide_venv/bin/activate
python
from bioinfokit.analys import fastq
fastq.sra_bd(file='SRR-file.txt')
for f in SRR*; do fasterq-dump $ f; done
I know it's clunky as heck but I'm new and it works!

Related

Gcloud components not being installed on local machine

I'm trying to use the gcloud components install to install anthoscli and kpt on my local machine but eventhough they are installed, everytime I try to run them as commands (e.g anthoscli apply) my zsh shell says there's no such command (eventhough kubectl works fine).
I tried to just to find where the component binaries are installed and then point to them in my .zshrc file but I couldn't find anywhere online that points to their file directory. The components seem to work as normal in my google cloud shell but not locally; any ideas?
You just need to search fot the command and include the directory in you $PATH variable.
To find the command anthoscli you should use the command:
find -name "*anthoscli*" -type f /
With the result, you can add the following line in your ~/.zshrc:
PATH="$PATH:<directory_found_in_previous_command>"
Then simply "reload" your zsh configuration with:
source ~/.zshrc

Git Pre-Commit Hook: Unable to Run `dartfmt` (command not found) (Windows)

Ideally, I would like to have dartfmt to format my code on every commit, and I think that git hooks are ideal for this. So far, I've tried the code found in this link, but with no success, despite it appearing on multiple other websites — maybe it's outdated.
In the end, I think nothing much more complicated than this should work in most cases (inside the .git/hooks/pre-commit file):
#!/bin/bash
dartfmt -w . # or maybe `flutter format .` for Flutter
The errors I get are:
For dartfmt -w .: dartfmt: command not found
For flutter format .: find: ‘> bin [’: No such file or directory
Both of those commands do work if placed directly in the terminal.
to make dartfmt work, try running which dartfmt manually to get the path to the executable, and then use the absolute path when calling it in the script.
If which isn't able to find it, and assuming you know the complete path to the directory where dartfmt is located, try adding that directory to PATH in the script:
#!/bin/bash
PATH="/path/to/dart-sdk/bin:$PATH"
export PATH
Also, I'd suggest taking a moment double check what git will use for the working directory when it calls those hook scripts. There might be some undesired behavior by using . if the CWD isn't what is expected. See this post.
To format your dart code regularly, you can follow one of the two ways mentioned below:
Preferred way:
In IntelliJ Idea go to Settings -> Language & Frameworks -> Flutter -> Select Format Code on save option.
This will format your code every few seconds. This is preferred because you can customize your personal formatting settings such as max words in a line etc.
Alternatively
From Official website run dartfmt -w bin lib to format your code from the command line.
Add dartfmt reference in PATH, like this:
export PATH="/xxx/flutter/bin/cache/dart-sdk/bin:$PATH"

Sourcing the source files using bash script

Usually I source all the macros I have for the jobs run in a remote machine using this command:
macros=$\my_directory
But I see someone uses a different way to get all the macros for submitting the jobs in a remote machine. He uses this command:
macros=$(dirname $(readlink -f $BASH_SOURCE))
Now I want to know how the $dirname has the advantages over giving the specific macro location. It would be great if you just explain to me regarding the sourcing the macro using $dirname
By using dirname you get the directory of where the script is located, therefore it's easy to source other files locally close to your script and don't worry about specifying the correct path each time the script bundle is relocated.
For instance if you have in your script source $macros/some_script.sh then it will not break when the bundle is located in the /usr/local/bin/ or /bin/ or ...
Regarding $BASH_SOURCE see: https://stackoverflow.com/a/35006505/2146346

Greadlink not working

recently I installed CoreUtils with HomeBrew for my terminal on macOS. However, when I use the greadlink command, I am unable to get the proper file path. What I mean to say is that every time I do the following:
My-MBP: insertnamehere$ greadlink -f something.apk
I get:
/Users/insertnamehere/projects/something.apk
When its actually located at:
/Users/insertnamehere/Documents/stuff/something.apk
The same happens for any directory. Basically, it will list the file that I'm trying to find directly under that directory.
Try using grealpath which gives more options like -P and -L etc.

How to open all mp3 files using windows command line?

If I have the following directory:
C:\Users\mkt\Desktop\Music\Tool\Lateralus
and want to open all files contained in the folder using cmd prompt. how could I do that?
I know that the following line will open one of them:
cd C:\Users\mkt\Desktop\Music\Tool\Lateralus\"01 - The Grudge.mp3"
But what about multiple files?
I am a noob at DOS and I really shouldn't be, but without practice you will never get better.
I am wondering, why it is opening your mp3 file with the cd command.
The cd command is used to switch directories, so this is something new for me.
I am a MAC OS user, so I could not test it, but if your given example worked, I think this should work too:
cd C:\Users\mkt\Desktop\Music\Tool\Lateralus\*.mp3
With the "*.mp3" you say, every mp3 file.
I hope this helps.

Resources