Get from the github readme:
gcc -g -O2 -Wall -o wgsim wgsim.c -lz -lm
Dear all,
I want to install wgsim on my Ubuntu 16.04 machine; I downloaded the zip file wgsim from the website, unpack it and moved it to /usr/local/lib/. I then ran the suggested commands (both with gcc and make) and I got:
:/usr/local/lib/wgsim$ sudo make wgsim
[sudo] password :
cc wgsim.c -o wgsim
/tmp/ccUBK42c.o: In function `ks_getc':
wgsim.c:(.text+0xe1): undefined reference to `gzread'
/tmp/ccUBK42c.o: In function `ks_getuntil':
wgsim.c:(.text+0x1df): undefined reference to `gzread'
/tmp/ccUBK42c.o: In function `ran_normal':
wgsim.c:(.text+0xab2): undefined reference to `log'
wgsim.c:(.text+0xacc): undefined reference to `sqrt'
/tmp/ccUBK42c.o: In function `wgsim_core':
wgsim.c:(.text+0x17d5): undefined reference to `log'
wgsim.c:(.text+0x1825): undefined reference to `gzopen'
wgsim.c:(.text+0x18f9): undefined reference to `gzclose'
wgsim.c:(.text+0x190d): undefined reference to `gzopen'
wgsim.c:(.text+0x2499): undefined reference to `gzclose'
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'wgsim' failed
make: *** [wgsim] Error 1
:/usr/local/lib/wgsim$ sudo gcc -g -Wall -O2 wgsim.c -o wgsim
/tmp/ccexR4pu.o: In function `ks_getuntil':
/usr/local/lib/wgsim/wgsim.c:41: undefined reference to `gzread'
/tmp/ccexR4pu.o: In function `ran_normal':
/usr/local/lib/wgsim/wgsim.c:77: undefined reference to `log'
/usr/local/lib/wgsim/wgsim.c:77: undefined reference to `sqrt'
/tmp/ccexR4pu.o: In function `ks_getc':
/usr/local/lib/wgsim/wgsim.c:41: undefined reference to `gzread'
/usr/local/lib/wgsim/wgsim.c:41: undefined reference to `gzread'
/usr/local/lib/wgsim/wgsim.c:41: undefined reference to `gzread'
/usr/local/lib/wgsim/wgsim.c:41: undefined reference to `gzread'
/tmp/ccexR4pu.o: In function `wgsim_core':
/usr/local/lib/wgsim/wgsim.c:250: undefined reference to `gzopen'
/usr/local/lib/wgsim/wgsim.c:260: undefined reference to `gzclose'
/usr/local/lib/wgsim/wgsim.c:262: undefined reference to `gzopen'
/usr/local/lib/wgsim/wgsim.c:370: undefined reference to `gzclose'
/usr/local/lib/wgsim/wgsim.c:248: undefined reference to `log'
collect2: error: ld returned 1 exit status
What I am missing? are there some dependencies?
Thanks
G
gcc -o wgsim wgsim.c -lm -lz
Get from the github readme:
gcc -g -O2 -Wall -o wgsim wgsim.c -lz -lm
I ran gcc -o wgsim wgsim.c -lm -lz and a wgsim command is created but when i run it on an example from the web i got:
:~/Documents/LAB/Lab book/Ery$ wgsim -N1000 -S1 ./genomes/NC_008253_1K.fna ./simulated_reads/sim_reads.fq /dev/null
No command 'wgsim' found, did you mean:
Command 'dwgsim' from package 'dwgsim' (universe)
wgsim: command not found
:~/Documents/LAB/Lab book/Ery$ /usr/local/lib/wgsim/wgsim -N1000 -S1 ./genomes/NC_008253_1K.fna ./simulated_reads/sim_reads.fq /dev/null
[wgsim] file open error
$ sudo !!
sudo /usr/local/lib/wgsim/wgsim -N1000 -S1 ./genomes/NC_008253_1K.fna ./simulated_reads/sim_reads.fq /dev/null
[sudo] password for :
[wgsim] file open error
Don't run user program using sudo. Not a good practice.
If you are trying to run wgsim from the directory where it is present then you need to either do it explicitly as ./wgsim or add the directory (in bash shell) where wgsim is located to $PATH simply by doing export PATH=$PATH:/path_to_wgsim You can add this line to ~/.profile file make the change permanent.
On Ubuntu 16, wgsim is also distributed in the samtools package.
I installed samtools but there is no wgsim:
Version: 0.1.19-96b5f2294a
Usage: samtools <command> [options]
Command: view SAM<->BAM conversion
sort sort alignment file
mpileup multi-way pileup
depth compute the depth
faidx index/extract FASTA
tview text alignment viewer
index index alignment
idxstats BAM index stats (r595 or later)
fixmate fix mate information
flagstat simple stats
calmd recalculate MD/NM tags and '=' bases
merge merge sorted alignments
rmdup remove PCR duplicates
reheader replace BAM header
cat concatenate BAMs
bedcov read depth per BED region
targetcut cut fosmid regions (for fosmid pool only)
phase phase heterozygotes
bamshuf shuffle and group alignments by name
It is in /usr/lib/samtools/wgsim, so not in your PATH.
Log in to answer this question.