how to fix featureCounts in miniconda (Linux) with error "featureCounts: invalid option -- 'r'" - terminal

featureCounts was called under minconda in Linux subsystem on a Windows 10 computer.
featureCounts -a /mnt/d/.../__.txt -F SAF -readExtensions3 200 -o ___.tsv -O file1.bam file2.bam file3p.bam file4.bam file5.bam file6.bam file7.bam file8.bam
This always results in an error message
featureCounts: invalid option -- 'r'
Version 2.0.1
Usage: featureCounts [options] -a <annotation_file> -o <output_file> input_file1 [input_file2] ...
## Mandatory arguments:
-a <string> Name of an annotation file. GTF/GFF format by default. See...
And then reprinting the required and optional arguments for featureCounts function.
Does anyone know what does the error message "invalid option --'r'" mean? And how can I fix it?
Is there any difference between calling featureCounts in command prompt (or Terminal on Mac) and calling it in Linux/miniconda3?

It seems that you mistyped option name, it should be --readExtension3 with two dashes in front of it and without 's' in the end. I had a similar problem with --fraction which led me here!

Related

Youtube-dl -o format: can I use conditions

I see so many questions on youtube-dl's -f flag. I want to know about the -o flag. I basically want to do:
-o '%(artist ? artist : "Unknown Artist")s/%(album ? album : "Unknown Album")s/%(track ? track : title)s.%(ext)s'
or if you come from some languages, this might make more sense:
-o '%(artist ?? "Unknown Artist")s/%(album ?? "Unknown Album")s/%(track ?? title)s.%(ext)s'
So how can I do this? The goal is to avoid youtube-dl from making default folders like NA, or to use a more appropriate field when applicable, or even pass in shell args to use as defaults when the tags don't exist.
EDIT
Since it was requested, here is what prompted this:
I am trying to download this playlist. Let's look at these two videos in particular:
https://youtu.be/1HTjrjjmBPU
https://youtu.be/6nllogf68FE
When I run
youtube-dl -o '%(artist)s/%(album)s/%(track)s.%(ext)s' <url>
the resulting output directories are
The Oh Hellos/Dear Wormwood/Prelude.f137.mp4
NA/NA/NA.f137.mp4
The first one is completely acceptable, but the second one is obviously not. I would like to be able to apply a conditional formatting so that the output of the first command stays the same, and the second command outputs either
The Oh Hellos/Dear Wormwood/Exeunt.f137.mp4
or
Unknown Artist/Unknown Album/The Oh Hellos - Exeunt.f137.mp4
You have three options.
Use --output-na-placeholder Unknown to make Unknown directories instead of NA directories.
Create symbolic links for NA to Unknown Artist/Unknown Album:
mkdir "Unknown Artist"; ln -s "Unknown Artist" NA; cd "Unknown Artist"; mkdir "Unknown Album"; ln -s "Unknown Album" NA
Use yt-dlp for defaults:
yt-dlp -o '%(artist|Unknown Artist)s/%(album|Unknown Album)s/%(track|Unknown Track)s.%(ext)s' <url>
Tested: [download] Destination: Unknown Artist/Unknown Album/Unknown Track.mp4

snmpd.conf clientaddr not working for sending trap /inform with given IP source address

Given the following sample/simple snmpd.conf (Net-SNMP 5.7.2 on RHEL 7.4)
rwcommunity private 192.168.56.101
trapsess -Ci --clientaddr=192.168.56.128 -v 2c -c private 192.168.56.101:162
when starting a SNMP Daemon
snmpd -f -Lo -D -C -c data/snmpd_test.conf udp:192.168.56.128:161
We obtain ''Start Up'' InformRequest with IP source 192.56.168.1 instead of ...128 (WireShark snapshot below)
It is not surprising as the -D option allows us to output the debug information saying that
trace: netsnmp_config_process_memory_list(): read_config.c, 696:
read_config:mem: processing memory: clientaddr 192.168.56.128
trace: run_config_handler(): read_config.c, 562:
9:read_config:parser: clientaddr handler not registered for this time
Web sources however say:
snmp.conf
...This value is also used by snmpd when generating notifications.
snmpd.conf
trapsess [SNMPCMD_ARGS] HOST
provides a more generic mechanism for defining notification destinations.
SNMPCMD_ARGS should be the command-line options required for an equivalent
snmptrap (or snmpinform) command to send the desired notification
I read also some old threads like this one
However this option is working well with snmptrap
snmptrap -D -Lo -Ci --clientaddr=192.168.56.128 -M+path_to_my_mibs -v 2c -c private 192.168.56.101:162 "" .1.3.6.1.4.1.a.b.c.d.e.f.0 i 0
This option is also working when placed in snmp.conf ( mind there is no 'd' here ) and then it applies to snmpset and snmpget (and maybe other)
So my question is: Is it a documentation error, a bug, a misuse of the Net-SNMP stack ?
After a long struggle I may have an answer and I write a short note as I just found a trick
It seems that clientaddr is not parsed correctly wherever in the snmpd.conf
(I tried not also inside the trapsess line)
But it seems to be a valid option in the command line of snmpd
like it was a valid option in the snmptrap command line. So I assumed it could be the same parsing mechanism for both.
a condition also is that the IP addres must be valid one
which means that
snmpd -f -Lo -D -C -c data/snmpd_test.conf --clientaddr=192.168.56.128 udp:192.168.56.128:161
seems to fully solve my problem.
I will perform more tests and if accurate format this answer a little bit better but it seems a good hint.

Getting GATK argument error and dont understand?

Hello bash programmers, I am using GATK and trying to loop through my bam files and do local realignment using my target_intervals and known indels. Below is my code I am trying. I am hoping someone can help with the error and correct my code.
# do the local realignment.
echo "local realignment..."
for file in `ls -d adp/map/*marked_duplicates.bam`
do
java -jar ~/software/GenomeAnalysisTK-3.3-0/GenomeAnalysisTK.jar \
-T IndelRealigner \
-R ~/flybase/fb-r5.57/dmel-all-chromosome-r5.57.fasta \
-I $file \
-known adp/map/*indel_intervals.vcf \
-targetIntervals adp/map/*target_intervals.list \
-o ${file}_realigned_reads.bam
done
wait
# Create a new index file.
echo "indexing the realigned bam file..."
for file in `ls -d adp/map/*realigned_reads.bam`
do
~/software/samtools-1.2/samtools index $file
done
ERROR: when looking this up, it appears to be a coding issue, and I am not seeing it.
##### ERROR ------------------------------------------------------------------------------------------
##### ERROR A USER ERROR has occurred (version 3.3-0-g37228af):
##### ERROR
##### ERROR This means that one or more arguments or inputs in your command are incorrect.
##### ERROR The error message below tells you what is the problem.
##### ERROR
##### ERROR If the problem is an invalid argument, please check the online documentation guide
##### ERROR (or rerun your command with --help) to view allowable command-line arguments for this tool.
##### ERROR
##### ERROR Visit our website and forum for extensive documentation and answers to
##### ERROR commonly asked questions http://www.broadinstitute.org/gatk
##### ERROR
##### ERROR Please do NOT post this error to the GATK forum unless you have really tried to fix it yourself.
##### ERROR
##### ERROR MESSAGE: Invalid argument value 'adp/map/360M_F_L002.recal.bam.sorted.bam_marked_duplicates.bam_target_intervals.list' at position 10.
##### ERROR Invalid argument value 'adp/map/517_F_L002.recal.bam.sorted.bam_marked_duplicates.bam_target_intervals.list' at position 11.
##### ERROR Invalid argument value 'adp/map/517M_F_L002.recal.bam.sorted.bam_marked_duplicates.bam_target_intervals.list' at position 12.
##### ERROR Invalid argument value 'adp/map/900_F_L002.recal.bam.sorted.bam_marked_duplicates.bam_target_intervals.list' at position 13.
##### ERROR Invalid argument value 'adp/map/900M_F_L002.recal.bam.sorted.bam_marked_duplicates.bam_target_intervals.list' at position 14
.
At least part of the problem is the * in your commands. GATK doesn't deal well with globs. To specify multiple values to an argument, specify the argument multiple times.
i.e. instead of
-known adp/map/*indel_intervals.vcf
you need to specify each file with a separate argument
-known adp/map/first_file.indel_intervals.vcf
-known adp/map/second_file.indel_intervals.vcf
There may be other issues as well. For instance, I'm not certain that -targetIntervals can take multiple files as input. Also, that's very old version of gatk, you might want to upgrade to 3.8.

what shasum: elasticsearch-5.0.0.deb.sha1: no properly formatted SHA1 checksum lines found means?

I want to install elasticsearch5.6.4 on ubuntu 17.10. So I downloaded elasticsearch.deb and elasticsearch.deb.sha1. As the sturcture said in this guide, after I run
shasum -a 512 -c elasticsearch-6.2.1.tar.gz.sha512
I have gotten this error:
shasum: elasticsearch-5.6.4.deb.sha1: no properly formatted SHA1 checksum lines found
What does this error mean? and what should I do?
You are correct and I'm a bit puzzled (since I've written that section in the Elastic docs): shasum -a 512 works on other operating systems and checking the man page, I would have thought it should do the same on Ubuntu:
-a, --algorithm 1 (default), 224, 256, 384, 512, 512224, 512256
When verifying SHA-512/224 or SHA-512/256 checksums, indicate the
algorithm explicitly using the -a option, e.g.
shasum -a 512224 -c checksumfile
I'm not sure why shasum -a 512 doesn't work here, but these 3 alternatives all give you the correct result:
shasum -c elasticsearch-6.2.1.deb.sha512 -a 512
shasum -a 512256 -c elasticsearch-6.2.1.deb.sha512
sha512sum -c elasticsearch-6.2.1.deb.sha512
This answer is not so much for the OP (who is hopefully sorted now) but any passers by who encounter the error in the question.
The error
shasum: [CHECKSUM_FILENAME] : no properly formatted SHA[TYPE] checksum lines found
indicates that the checksum file passed to the -c flag is not formatted as
follows
a67eb6eeeff63ac77d34c2c86b0a3fa97f69a9d3f8c9d34c20036fa79cb4214d ./kbld-linux-amd64
Where
the first field is the expected checksum,
the second field is a ' ' character indicating that the file is to be checked as a text file (as opposed to being checked as a binary file or being checking in Universal mode which ignores newlines)
and the third field is the name of the file you likely just downloaded and whose integrity you want to verify
So in the example above the developers who created kbld supplied the above text on their release page to show the checksums that they calculated after they built the kbld binaries for various platforms.
I added the line for the linux build to a file called kbld_v0_7_0.checksum and then I ran the following in the directory where I downloaded the kbld-linux-amd64 binary
$ shasum -c kbld_v0_7_0.checksum -a 256
./kbld-linux-amd64: OK
The OK from shasum shows that the binary that I downloaded, ./kbld-linux-amd64 , generates the same sha256 checksum that was produced when the developers did their build which indicates that the files are, in all likelihood, identical

what ps -e -o user:20, pid means?

I have a already written script which has this line PID = ps -e -o user:20,pid,cmd
Could anybody explain me the meaning of this line? I am bit confused with user:20 part
Thanks!
ps is a command name used to show processes running in the system currently.
-e is a "short" option which means that all processes should be listed.
-o user:20,pid,cmd is an option which sets expected format of lines to be printed on screen, i.e. we want the first column to contain usernames (who own the processes) padded to 20 characters, the second column to show process IDs and the third column to contain command names which have been used to start the processes. Just that.
Also, you can simply try to run this yourself in your terminal: ps -e -o user:20,pid,cmd and see what happens.
From ps's man page:
-o format
User-defined format. format is a single argument in the form of a blank-separated or comma-separated list, which offers a way to specify
individual output columns. The recognized keywords are described in the STANDARD FORMAT SPECIFIERS section below. Headers may be renamed (ps
-o pid,ruser=RealUser -o comm=Command) as desired. If all column headers are empty (ps -o pid= -o comm=) then the header line will not be
output. Column width will increase as needed for wide headers; this may be used to widen up columns such as WCHAN (ps -o pid,wchan=WIDE-
WCHAN-COLUMN -o comm). Explicit width control (ps opid,wchan:42,cmd) is offered too. The behavior of ps -o pid=X,comm=Y varies with
personality; output may be one column named "X,comm=Y" or two columns named "X" and "Y". Use multiple -o options when in doubt. Use the
PS_FORMAT environment variable to specify a default as desired; DefSysV and DefBSD are macros that may be used to choose the default UNIX or
BSD columns.
Explicit width control (ps opid,wchan:42,cmd) is offered too.
So you'll get a user column with 20-char's width.
ps - This command report a snapshot of the current processes.
-e , This options helps to select all processes.Identical to -A.
-o , This options helps to specify user-defined format.
user:20 ,
This will help to format the output of ps command.The user:20 will add some extra 20 space character betweens the columns. Below the example will help you to find the difference.
jdeveloper#jdeveloper ~ $ ps -e -o user:20,pid
USER PID
root 2926
jdeveloper 2948
root 3255
root 3570
root 3802
jdeveloper 3825
jdeveloper 3860
Now , lets try with 10 character space padding in response.
jdeveloper#jdeveloper ~ $ ps -e -o user:10,pid
USER PID
root 2926
jdeveloper 2948
root 3255
root 3570
root 3802
jdeveloper 3825
jdeveloper 3863
Find more about ps command using man command.Try
jdeveloper#jdeveloper ~ $ man ps
Hope it will help you.

Resources