NotImplementedError: "intersectBed" does not appear to be installed or on the path, so this method is disabled. Please install a more recent version of BEDTools and re-import to use this method
1
0
Entering edit mode
2.6 years ago
Varun • 0
from keras.layers import Conv2D
from keras.layers import AveragePooling2D
from janggu import inputlayer
from janggu import outputconv
from janggu import DnaConv2D
from janggu.data import ReduceDim


# load the dataset which consists of
# 1) a reference genome
REFGENOME = resource_filename('janggu', 'resources/pseudo_genome.fa')
# 2) ROI contains regions spanning positive and negative examples
ROI_FILE = resource_filename('janggu', 'resources/roi_train.bed')
# 3) PEAK_FILE only contains positive examples
PEAK_FILE = resource_filename('janggu', 'resources/scores.bed')

# DNA sequences are loaded directly from the reference genome
DNA = Bioseq.create_from_refgenome('dna', refgenome=REFGENOME,
                                   roi=ROI_FILE,
                                   binsize=200)

# Classification labels over the same regions are loaded into the Coverage dataset. It is important that both DNA and LABELS load with the same binsize, stepsize to ensure the correct correspondence between both datasets. Finally, the ReduceDim dataset wrapper transforms the 4D Coverage object into a 2D table like object (regions by conditions)


LABELS = ReduceDim(Cover.create_from_bed('peaks', roi=ROI_FILE,bedfiles=PEAK_FILE,binsize=200,resolution=None), aggregator='mean')


# 2. define a simple conv net with 30 filters of length 15 bp and relu activation. outputconv as opposed to outputdense will put a conv layer as output


@inputlayer

@outputdense('sigmoid')

def double_stranded_model(inputs, inp, oup, params):
    with inputs.use('dna') as layer:
        # The DnaConv2D wrapper can be used with Conv2D
        # to scan both DNA strands with the weight matrices.
        layer = DnaConv2D(Conv2D(params[0], (params[1], 1),
                                 activation=params[2]))(layer)

    output = GlobalAveragePooling2D(name='motif')(layer)
    return inputs, output


# 3. instantiate and compile the model
model = Janggu.create(template=double_stranded_model,
                      modelparams=(30, 15, 'relu'),
                      inputs=DNA, outputs=LABELS)
model.compile(optimizer='adadelta', loss='binary_crossentropy',
              metrics=['acc'])

# 4. fit the model
model.fit(DNA, ReduceDim(LABELS, epochs=100))

enter image description here

I am using google collab. Please tell me how to add bedtools path in google collab. I have already read the documentation cannot make anything out of it. I am trying to solve this issue for one week. Thank You.

bedtools googlecollab janggu pybedtools • 2.2k views
ADD COMMENT
0
Entering edit mode

Can anyone help with this issue?

ADD REPLY
0
Entering edit mode

Hiya can you please include how you resolved this? i'm trying to sort this on my mac - adding "PATH" to bashrc or zshrc profile and sourcing it did not work - any ideas why?

ADD REPLY
1
Entering edit mode
2.6 years ago
Varun • 0

I have solved this issue. If anyone has a similar error. Do ask . I would be happy to help. Thanks!

ADD COMMENT
1
Entering edit mode

Just saying you solved the error does not help future visitors to this thread. Please include the solution by editing this answer.

ADD REPLY

Login before adding your answer.

Traffic: 3383 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6