Answers.Body: <p>It seems that the author of CRCmapper.py wants to extract <code>sequence_name</code>, <code>start</code>, <code>stop</code> columns from <code>fimo.txt</code> file. But the code extract <code>motif_alt_id</code>, <code>sequence_name</code>, <code>start</code> columns. So the index of the code should be changed.</p>
  
  <p><code>fimo.txt</code> looks like this:</p>
  
  <pre><code>motif_id    motif_alt_id    sequence_name   start   stop    strand  score   p-value q-value matched_sequence
  Transfac.V$AP1_02   AP1 NM_003046931|3|95762|152118 2332    3118    -   11.9802 6.49e-05        TGACTCA
  </code></pre>
  
  <p>In line 377-382 of the code:</p>
  
  <p><code>line[1]</code> should be changed to <code>line[2]</code>.</p>
  
  <pre><code>for line in fimoTable[1:]:
      source = motifDatabaseDict[line[0]]
      region = line[1].split('|')
      target = refseqToNameDict[region[0]]
      location = (region[1], int(region[2]), int(region[3]))
  </code></pre>
  
  <p>In line 391-394 of the code:</p>
  
  <p><code>line[2]</code> should be changed to <code>line[3]</code>, <code>line[3]</code> should be changed to <code>line[4]</code>.</p>
  
  <pre><code>    # Count unique motifs
      if (region[1], int(region[2]) + int(line[2]), int(region[2]) + int(line[3])) not in motifDictSE[source]:
          edgeCountDictSE[(source, target)] += 1
          motifDictSE[source].append((region[1], int(region[2]) + int(line[2]), int(region[2]) + int(line[3])))
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-25T02:54:00.713Z
Answers.LastActivityDate: 2018-10-25T03:01:17.470Z
Answers.LastEditDate: 2018-10-25T03:01:17.470Z
Answers.UserDisplayName: ying
Answers.Body: <p>This error came from the fact that  the output of the new fimo version has an additional 'motif_alt_id' column in second position. </p>
  
  <p>CRCmapper has been modified to take this into account. You can find the updated version here: <a href="https://bitbucket.org/young_computation/crcmapper/src/master/" rel="nofollow noreferrer">https://bitbucket.org/young_computation/crcmapper/src/master/</a></p>
  
  <p>P.S.: sorry if we missed you request user1545 and thanks for using CRCmapper!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-24T17:52:19.263Z
Answers.LastActivityDate: 2019-07-24T17:52:19.263Z
Answers.UserDisplayName: Violaine Saint-André
Body: <p>I'm using <a href="https://bitbucket.org/young_computation/crcmapper/overview" rel="nofollow noreferrer">CRCmapper</a> on my data. There are several modules in the tool. I've used exactly instructed in the usage.</p>
  
  <p>Commands used:</p>
  
  <pre><code>python CRCmapper.py -e MB12_noEncBlack_AllEnhancers.table.txt -b MB12.bam -g HG19 -f hg19-stdChr/ -s MB12_peaks.bed -n MB12 -o MB12/
  </code></pre>
  
  <p>Here is the error I got:</p>
  
  <pre><code>Warning: text mode turns off computation of q-values
  IDENTIFY TF-TF INTERACTIONS
  Traceback (most recent call last):
    File "CRCmapper.py", line 605, in &lt;module&gt;
      main()
    File "CRCmapper.py", line 593, in main
      graph = buildNetwork(projectFolder, projectName, candidateGenes, refseqToNameDict, motifConvertFile)
    File "CRCmapper.py", line 381, in buildNetwork
      target = refseqToNameDict[region[0]]
  KeyError: 'AP1'
  </code></pre>
  
  <p>My expertise in python is very basic. I would be grateful if someone take a look at this error and suggest how to fix.</p>
  
  <p>P.S. I contacted authors a long back, I didn't get any response.</p>
  
  <p>Thank you.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-28T10:55:11.780Z
Comments.Text: It seems that the problem is within the files, are you sure that AP1 is in all your files? It could also be a bug on the software
Comments.UserDisplayName: llrs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-28T13:33:35.190Z
Comments.Text: Yeah, it exists. For other samples, it is a different motif for different sample. It seems to be a bug in the software but I've no idea. Hope someone here will be able to understand.
Comments.UserDisplayName: user1545
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-28T13:47:01.840Z
Comments.Text: Could you paste the minimal files that reproduce the bug? Maybe you can even propose a change in the repository to fix it
Comments.UserDisplayName: llrs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-28T13:59:39.887Z
Comments.Text: Yeah, I will prepare an example to reproduce. They haven't enabled the issue creator for their repo.
Comments.UserDisplayName: user1545
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-09-28T14:52:05.327Z
Comments.Text: Well you can do directly a pull request
Comments.UserDisplayName: llrs
Tags: <python><networks>
Title: help with CRCmapper
ThreadText: # help with CRCmapper
  
  (Asked by: username_0 on 2017-09-28)
  
  I'm using [CRCmapper](https://bitbucket.org/young_computation/crcmapper/overview) on my data. There are several modules in the tool. I've used exactly instructed in the usage.
  
  Commands used:
  
  ```
  python CRCmapper.py -e MB12_noEncBlack_AllEnhancers.table.txt -b MB12.bam -g HG19 -f hg19-stdChr/ -s MB12_peaks.bed -n MB12 -o MB12/
  
  ```
  
  Here is the error I got:
  
  ```
  Warning: text mode turns off computation of q-values
  IDENTIFY TF-TF INTERACTIONS
  Traceback (most recent call last):
    File "CRCmapper.py", line 605, in <module>
      main()
    File "CRCmapper.py", line 593, in main
      graph = buildNetwork(projectFolder, projectName, candidateGenes, refseqToNameDict, motifConvertFile)
    File "CRCmapper.py", line 381, in buildNetwork
      target = refseqToNameDict[region[0]]
  KeyError: 'AP1'
  
  ```
  
  My expertise in python is very basic. I would be grateful if someone take a look at this error and suggest how to fix.
  
  P.S. I contacted authors a long back, I didn't get any response.
  
  Thank you.
  
  **Tags:** python, networks
  
  > **Comments:**
  > **username_1**: It seems that the problem is within the files, are you sure that AP1 is in all your files? It could also be a bug on the software  
  > **username_0**: Yeah, it exists. For other samples, it is a different motif for different sample. It seems to be a bug in the software but I've no idea. Hope someone here will be able to understand.  
  > **username_1**: Could you paste the minimal files that reproduce the bug? Maybe you can even propose a change in the repository to fix it  
  > **username_0**: Yeah, I will prepare an example to reproduce. They haven't enabled the issue creator for their repo.  
  > **username_1**: Well you can do directly a pull request  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-10-25. Score: 2
  
  It seems that the author of CRCmapper.py wants to extract `sequence_name`, `start`, `stop` columns from `fimo.txt` file. But the code extract `motif_alt_id`, `sequence_name`, `start` columns. So the index of the code should be changed.
  
  `fimo.txt` looks like this:
  
  ```
  motif_id    motif_alt_id    sequence_name   start   stop    strand  score   p-value q-value matched_sequence
  Transfac.V$AP1_02   AP1 NM_003046931|3|95762|152118 2332    3118    -   11.9802 6.49e-05        TGACTCA
  
  ```
  
  In line 377-382 of the code:
  
  `line[1]` should be changed to `line[2]`.
  
  ```
  for line in fimoTable[1:]:
      source = motifDatabaseDict[line[0]]
      region = line[1].split('|')
      target = refseqToNameDict[region[0]]
      location = (region[1], int(region[2]), int(region[3]))
  
  ```
  
  In line 391-394 of the code:
  
  `line[2]` should be changed to `line[3]`, `line[3]` should be changed to `line[4]`.
  
  ```
      # Count unique motifs
      if (region[1], int(region[2]) + int(line[2]), int(region[2]) + int(line[3])) not in motifDictSE[source]:
          edgeCountDictSE[(source, target)] += 1
          motifDictSE[source].append((region[1], int(region[2]) + int(line[2]), int(region[2]) + int(line[3])))
  
  ```
  
  
  ---
  
  ### Answer by username_3 on 2019-07-24. Score: 2
  
  This error came from the fact that the output of the new fimo version has an additional 'motif\_alt\_id' column in second position.
  
  CRCmapper has been modified to take this into account. You can find the updated version here: <https://bitbucket.org/young_computation/crcmapper/src/master/>
  
  P.S.: sorry if we missed you request username_0 and thanks for using CRCmapper!
  
  
  ---
  
  