TVB-Framework command initialisation

In [1]:
from tvb.interfaces.command.lab import *
from tvb.adapters.creators.allen_creator import AllenConnectomeBuilder
from tvb.adapters.creators.allen_creator import AllenConnectModel
from tvb.core.adapters.abcadapter import ABCAdapter
from tvb.core.services.operation_service import OperationService
2020-10-28 21:07:18,887 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_adapters.DistanceDBIN'>
2020-10-28 21:07:18,888 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_adapters.DistanceDWEI'>
2020-10-28 21:07:18,888 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_adapters.DistanceNETW'>
2020-10-28 21:07:18,889 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_adapters.DistanceRDA'>
2020-10-28 21:07:18,890 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_adapters.DistanceRDM'>
2020-10-28 21:07:18,890 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_adapters.ModularityOCSM'>
2020-10-28 21:07:18,891 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_adapters.ModularityOpCSMU'>
2020-10-28 21:07:18,897 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_centrality_adapters.CentralityEdgeBinary'>
2020-10-28 21:07:18,898 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_centrality_adapters.CentralityEdgeWeighted'>
2020-10-28 21:07:18,899 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_centrality_adapters.CentralityEigenVector'>
2020-10-28 21:07:18,899 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_centrality_adapters.CentralityKCoreness'>
2020-10-28 21:07:18,900 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_centrality_adapters.CentralityKCorenessBD'>
2020-10-28 21:07:18,901 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_centrality_adapters.CentralityNodeBinary'>
2020-10-28 21:07:18,901 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_centrality_adapters.CentralityNodeWeighted'>
2020-10-28 21:07:18,902 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_centrality_adapters.CentralityShortcuts'>
2020-10-28 21:07:18,902 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_centrality_adapters.FlowCoefficients'>
2020-10-28 21:07:18,903 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_centrality_adapters.ParticipationCoefficient'>
2020-10-28 21:07:18,903 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_centrality_adapters.ParticipationCoefficientSign'>
2020-10-28 21:07:18,904 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_centrality_adapters.SubgraphCentrality'>
2020-10-28 21:07:18,908 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_clustering_adapters.ClusteringCoefficient'>
2020-10-28 21:07:18,909 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_clustering_adapters.ClusteringCoefficientBU'>
2020-10-28 21:07:18,910 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_clustering_adapters.ClusteringCoefficientWD'>
2020-10-28 21:07:18,910 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_clustering_adapters.ClusteringCoefficientWU'>
2020-10-28 21:07:18,911 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_clustering_adapters.TransitivityBinaryDirected'>
2020-10-28 21:07:18,912 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_clustering_adapters.TransitivityBinaryUnDirected'>
2020-10-28 21:07:18,913 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_clustering_adapters.TransitivityWeightedDirected'>
2020-10-28 21:07:18,913 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_clustering_adapters.TransitivityWeightedUnDirected'>
2020-10-28 21:07:18,918 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_degree_adapters.Degree'>
2020-10-28 21:07:18,918 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_degree_adapters.DegreeIOD'>
2020-10-28 21:07:18,919 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_degree_adapters.DensityDirected'>
2020-10-28 21:07:18,920 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_degree_adapters.DensityUndirected'>
2020-10-28 21:07:18,920 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_degree_adapters.JointDegree'>
2020-10-28 21:07:18,921 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_degree_adapters.MatchingIndex'>
2020-10-28 21:07:18,922 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_degree_adapters.Strength'>
2020-10-28 21:07:18,922 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_degree_adapters.StrengthISOS'>
2020-10-28 21:07:18,923 - WARNING - tvb.config.init.introspector_registry - Skipped Adapter(probably because MATLAB not found):<class 'tvb.adapters.analyzers.bct_degree_adapters.StrengthWeights'>
2020-10-28 21:07:20,054 - INFO - tvb.config.init.model_manager - Database already has some data, will not be re-created!
In [2]:
list_projects()
                    name    id
         Default_Project     1
                 sandbox     2
In [3]:
builder_instance = ABCAdapter.build_adapter_from_class(AllenConnectomeBuilder)

# The corresponding view_model is AllenConnectModel. You can either instantiate it directly or get it by calling
# the get_view_model_class adapter function.
view_model = builder_instance.get_view_model_class()()

view_model.resolution = 100
view_model.weighting = 1
view_model.inj_f_thresh = 80
view_model.vol_thresh= 100000000

# This ID of a project needs to exists in Db, and it can be taken from the WebInterface:
launched_operation = fire_operation(1, builder_instance, view_model)
launched_operation
2020-10-28 21:07:41,317 - INFO - tvb.core.services.operation_service - Starting operation AllenConnectomeBuilder
2020-10-28 21:07:41,365 - INFO - tvb.core.services.operation_service - Finished operation launch:AllenConnectomeBuilder
2020-10-28 21:07:41,369 - INFO - tvb.interfaces.command.lab - Operation launched....
Out[3]:
<Operation('1f162913e6e64f3998ee68a7d9e7d1de', da2aca34-1950-11eb-a6ec-faffc245676e, 2,'1','64','2020-10-28 21:07:41.324631','None', 'None','4-PENDING',True, 'None', '', '', 0)>
In [4]:
launched_operation = wait_to_finish(launched_operation)
launched_operation
2020-10-28 22:18:24,386 - INFO - tvb.core.services.backend_clients.standalone_client - Finished with launch of operation 14
2020-10-28 22:18:24,426 - INFO - tvb.interfaces.command.lab - Operation finished successfully
Out[4]:
<Operation('1f162913e6e64f3998ee68a7d9e7d1de', da2aca34-1950-11eb-a6ec-faffc245676e, 2,'1','64','2020-10-28 21:07:41.324631','2020-10-28 21:07:44.830987', '2020-10-28 22:18:23.937416','5-FINISHED',True, 'None', '2020-10-28,22-18-23', '', -1)>

At this point, your operation of Allen DB import should be running in the background. If you launch TVB web GUI, and you go to Project -> Operations page, you should see the new operation running (state color BLUE).

When done, your results will be ready for inspection in TVB web GUI. Do not close your computer until the operation has finished. If you do so, then relaunch after you restart. Downloaded files will not be lost, but found by the new operation.

In [5]:
list_operation_results(launched_operation.id)
              id                     type                              gid         date
              29        ConnectivityIndex d177bb2bd41a493a8e4219b07172f0c2 2020-10-28 22:18:23.765955
              30              VolumeIndex 02774701f71e4a06ac13d1911227b152 2020-10-28 22:18:23.811680
              31 RegionVolumeMappingIndex 5af200c9c346419bb896b1b910b409f6 2020-10-28 22:18:23.849573
              32       StructuralMRIIndex 8c652d1873804ba6af832586ac67fcc7 2020-10-28 22:18:23.891895