Recent Posts

Pages: 1 2 [3] 4 5 6
21
General Discussion / Re: Error converting PWM to PSAM
« Last post by xiangjun on December 19, 2017, 01:12:49 pm »
Hi Jason,

I've looked into the issue. As expected, it is indeed yet another PWM variant that need special attention to be converted to PSAM.

One example (YDR146C_569.pwm) from Expert_PWMs.tar.gz is as below:

Code: [Select]
A 0.381537584575116 1.07668300283655 -800 -800 1.68965987938785 -800 -800 0.989220160345073
T -0.31034012061215 -3.01077985606558 -800 -800 -800 -800 -800 -2.01077983731055
G 0.395928676331139 -2.30451105912229 -800 -800 -800 2.39592867633114 -800 -1.30451104036726
C -0.982582949230903 0.502843879011055 2.39592867633114 2.39592867633114 -800 -800 2.39592867633114 0.280451460353898

It has negative values, including a presumably cutoff value of -800. On the other hand, entries in PSAM should all be positive. So we need a way to convert the negative values to positive ones.

In a similar case, the TAMO (as in the MacIsaac dataset) format distributed with the REDUCE Suite looks like the following:

Code: [Select]
Log-odds matrix for Motif   0 rGAA..TtctrGAA (0)
#        0         1         2         3         4         5         6         7         8         9        10        11        12        13
#A     0.743    -1.052     1.647     1.443    -1.558    -0.374    -3.255    -5.001    -0.793    -2.480     1.175    -3.678     1.635     1.629
#C    -1.105   -10.336    -8.324    -3.641     0.691     0.311    -1.463    -0.208     1.931    -1.053    -2.000   -10.641    -2.819    -4.350
#T    -3.868    -3.114    -4.032    -2.297     0.288    -0.426     1.428     1.320    -2.576     1.393    -5.066    -3.566    -5.030    -3.764
#G     0.967     2.100    -4.305    -1.267     0.140     0.632    -1.563    -1.879    -2.088    -2.285     0.357     2.321    -8.368    -4.399

Here, Convert2PSAM performs a 2**score transformation so that the scores become positive.

Should we take a similar transformation for the Expert_PWMs.tar.gz data? Harmen, what's your take?

Please let me know your opinions.

Xiang-Jun


PS. For the record, it is worth noting that the $REDUCE_SUITE/data/formats/ folder contains several other commonly used PWM-like files that can be handled by Convert2PSAM.

Code: [Select]
#transfac.dat
ID any_old_name_for_motif_1
BF species_name_for_motif_1
P0      A      C      G      T
01      1      2      2      0      S
02      2      1      2      0      R
03      3      0      1      1      A
04      0      5      0      0      C
05      5      0      0      0      A
06      0      0      4      1      G
07      0      1      4      0      G
08      0      0      0      5      T
09      0      0      5      0      G
10      0      1      2      2      K
11      0      2      0      3      Y
12      1      0      3      1      G
XX
//

Code: [Select]
#jaspar_ex1.dat
 1  6  1  0 13  0  6  0 13 15  2  5
 4  0  0  0  1 15  0  9  4  0  3  5
 8 12  0  3  2  1 12  0  1  1  1  3
 5  0 17 15  2  2  0  9  0  2 12  5

Code: [Select]
#jaspar_ex2.dat
A  [ 1  6  1  0 13  0  6  0 13 15  2  5 ]
C  [ 4  0  0  0  1 15  0  9  4  0  3  5 ]
G  [ 8 12  0  3  2  1 12  0  1  1  1  3 ]
T  [ 5  0 17 15  2  2  0  9  0  2 12  5 ]

The Convert2PSAM has been created explicitly for such real-world wild cases.
22
General Discussion / Re: Error converting PWM to PSAM
« Last post by xiangjun on December 18, 2017, 02:14:05 pm »
Hi Jason,

Thanks for using the REDUCE Suite and for posting on the Forum.

The error message seems to hint a PWM format variant that Convert2PSAM cannot handle. I'll look into the details, and revise Convert2PSAM as necessary. I'll post back on the Forum, probably by tomorrow.

Best regards,

Xiang-Jun
23
General Discussion / Error converting PWM to PSAM
« Last post by jason on December 18, 2017, 02:01:28 pm »
Hi, I've downloaded a set of PWMs from YeTFaSCo: http://yetfasco.ccbr.utoronto.ca/1.02/Downloads/Expert_PWMs.tar.gz

I would like to use these PWMs with the Transfactivity program.

However, I can't seem to get the convert2psam utility to work on these... I assume that it expects a slightly different PWM format than the ones provided by the download, but I can't figure out exactly what format it expects. Could you perhaps let me know if I'm doing something wrong?

Here's the command I ran and the error:

 bin/Convert2PSAM -source=pw -inp=data/yetfasco/ALIGNED_ENOLOGO_FORMAT_PWMS/YDR146C_569.pwm -pwmfile=test.xml

<data/yetfasco/ALIGNED_ENOLOGO_FORMAT_PWMS/YDR146C_569.pwm> not in PWM format: [A   0.381537584575116   1.07668300283655   -800   -800   1.68965987938785   -800   -800   0.989220160345073] contains invalid W a

24
General Discussion / Re: Error when generating logos in PDF format
« Last post by xiangjun on November 15, 2017, 11:09:40 pm »
As a followup, the REDUCE Suite has been updated to v2.2.4-2017nov16. The LogoGenerator bug for PDF output has been fixed. The obsolete GIF output has been removed to avoid a dependency on the convert program from ImageMagick. The default PNG format is the choice for use with HTMLSummary-generated webpage. The LogoGenerator documentation has been also revised.

Some examples:

Code: Ruby
  1. # By default, the output is in PNG format
  2. LogoGenerator -file=$REDUCE_SUITE/data/formats/psam_ex.dat -logo=sample.png
  3. # Using the -format=pdf option for PDF output
  4. LogoGenerator -file=$REDUCE_SUITE/data/formats/psam_ex.dat -logo=sample.pdf -format=pdf
  5. # Output in the raw EPS format with -format=eps
  6. LogoGenerator -file=$REDUCE_SUITE/data/formats/psam_ex.dat -logo=sample.eps -format=eps

The LogoGenerator utility in the REDUCE Suite is a general purpose, robust logo generator of DNA or RNA base sequences. It creates a logo in the vector EPS format, which can be easily converted to other vector or raster image format using numerous third-party tools. Internally, LogoGenerator takes advantage of the widely available gs program (Ghostscript).

It is worth noting that on Mac OS X, the preview program can directly read LogoGenerator-created EPS file and convert it to PDF format. On Linux and Windows, the situation should be similar.

Xiang-Jun
25
General Discussion / Re: Error when generating logos in PDF format
« Last post by xiangjun on November 15, 2017, 07:04:41 pm »
Hi Harmen,

Thanks for your quick feedback.

I'll update the software code with 'gif' output removed, but keep the PDF option. A new release will be made available on the download page late tonight.

Best regards,

Xiang-Jun

26
General Discussion / Re: Error when generating logos in PDF format
« Last post by hjb2004 on November 15, 2017, 06:56:27 pm »
Hi Xiang-Jun,

PDF support seems important to keep, and removing the option "-dTextAlphaBits=4" from config/pkg_settings.cfg completely solved the problem for me for this format, so I can continue with what I was doing now.

However, I agree that it will be best to discontinue GIF support. On my Mac at least, "convert" is not installed by default, and indeed GIF generation with "-format=gif" does not work:

$ LogoGenerator -file=results/psam_001.xml -format=gif
sh: line 6: convert: command not found
system('gs -sOutputFile=- \
   -sDEVICE=png16m \
   -dDEVICEWIDTHPOINTS=340 \
   -dDEVICEHEIGHTPOINTS=213 \
   -q -r96 -dSAFER -dBATCH -dNOPAUSE \
   ./temp_logo.eps \
   | convert png:- ./psam_001.gif
') returns nonzero (32512)


Thanks for the quick response!

Harmen
27
General Discussion / Re: Error when generating logos in PDF format
« Last post by xiangjun on November 15, 2017, 06:07:43 pm »
Hi Harmen,

Thanks for posting on the Forum!

Yes, I can reproduce the error message with regard to generating the logos in PDF format. It is indeed due to the Ghostscript "-dTextAlphaBits=4" option you reported. I am using Ghostscript 9.21.

I remember taking the "-dTextAlphaBits=4" option from reading on the docs/examples somewhere. Now that we know the problem, we have the following options to go:

  • Simply remove the "-dTextAlphaBits=4" option from the system call.
  • Or we can remove the support of the PDF output format (from the documentation).

While we are here, I'd also want to remove the largely out-of-date GIF output format. By doing so, we also get rid of the dependency on the convert from ImageMagick.

What's your take? Please let me know, and I will update and code for a new release late tonight (or tomorrow).

Xiang-Jun
28
General Discussion / Error when generating logos in PDF format
« Last post by hjb2004 on November 15, 2017, 05:36:00 pm »
Hi Xiang-Jun,

When I run these commands:

cd examples/MatrixREDUCE/spellman-alpha
sh commandline.sh
LogoGenerator -file=results/psam_001.xml -format=pdf

I get the following error:

GPL Ghostscript 9.19:

  ERROR:
    Can't set GraphicsAlphaBits or TextAlphaBits with a vector device.
Unrecoverable error: rangecheck in .putdeviceprops
system('gs -sOutputFile=./psam_001.pdf \
   -sDEVICE=pdfwrite \
   -dPDFSETTINGS=/printer \
   -dEmbedAllFonts=true \
   -dDEVICEWIDTHPOINTS=340 \
   -dDEVICEHEIGHTPOINTS=213 \
   -q -r96 -dTextAlphaBits=4 -dSAFER -dBATCH -dNOPAUSE \
   ./temp_logo.eps
') returns nonzero (65280)

The error seems to be triggered by the "-dTextAlphaBits=4" option. When I run "gs" manually without it, it work fine.

Seems that this is a known problem with more recent versions of "gs". I use version 9.19 on a Mac OS 10.11.6.

Thanks,
Harmen
29
General Discussion / Re: Affinity score calculation
« Last post by JonathanCan on September 11, 2017, 02:29:30 am »
Hi!

Can you explain how the the anadrol results of AffinityProbe is calculated (in what range)?

thanks!

Thanks for explaining Xiang-Jun!
30
Documentation / Re: Set up the REDUCE Suite
« Last post by xiangjun on June 19, 2017, 04:39:58 pm »
Hi Rahul,

Thanks for your feedback. Step #5 should work as is if step #4 has been performed as advertised, which adds the bin/ directory to PATH. I've slightly refined the instruction for step #4 to make it clearer.

Executing 'bin/MatrixREDUCE -h' assumes one is at the $REDUCE_SUITE root directory.

Xiang-Jun
Pages: 1 2 [3] 4 5 6
Created and maintained by Dr. Xiang-Jun Lu [律祥俊]. See also http://forum.x3dna.org and http://x3dna.org